Chandu yadav

Chandu yadav

810 Articles Published

Articles by Chandu yadav

Page 59 of 81

8086 program to find sum of digits of 8 bit number

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 2K+ Views

In this program we will see how to add the digits of an 8-bit number.Problem StatementWrite 8086 Assembly language program to add the digits of an 8-bit number stored in memory address 2000H.DiscussionTo get the digits of an 8-bit number, we can use the masking operation. At first we will mask the upper nibble, and then the lower nibble. After masking the upper nibble, we have to rotate it to the right to make it least significant nibble. Then we can simply add it to the stored nibble to get the sum.InputAddressData……20008A…… Flow Diagram ProgramOutputAddressData……200112……      

Read More

How to create JTable from two dimensional array in Java?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 853 Views

With two dimensional array, set the columns of a table. Additionally, we have set the rows using a one-dimensional array as shown below −DefaultTableModel tableModel = new DefaultTableModel(new Object[][] {    { "Mobile Phones", "100" }, { "RAM", "200" }, { "Caps", "50" },    { "Tablet", "80" }, { "LED", "400" }, { "Trousers", "350" },    { "T-Shirt", "500" }, { "Hoodie", "650" }, { "Jeans", "900" } },    new Object[] { "Items", "Quantity" } );Now set the table model to the table −JTable table = new JTable(tableModel);The following is an example to create a table from ...

Read More

MySQL query to get a field value that does not contain empty spaces?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 545 Views

Use NOT LIKE for this. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentFullName varchar(40)    ); Query OK, 0 rows affected (0.66 sec)Insert records in the table using insert command −mysql> insert into DemoTable(StudentFullName) values('JohnSmith'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable(StudentFullName) values('John Doe'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable(StudentFullName) values('Adam Smith'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable(StudentFullName) values('CarolTaylor'); Query OK, 1 row affected (0.19 sec)Display all records from the table using ...

Read More

8086 program to print the table of input integer

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 785 Views

In this program we will see how to generate table of an integer.Problem StatementWrite 8086 Assembly language program to generate a table of input integer. The number is stored at 500H, and the table will be stored at 600 onwards.DiscussionTable generation is basically the multiplication table creation. We are taking the number and initialize the counter as 0. In each step increasing the counter by 1, and multiply it with the number, then store it into the memory address. When counter becomes 0A (10 in decimal), then it stops.InputAddressData……5004…… Flow Diagram ProgramOutputAddressData……60004601086020C6031060414605186061C607206082460928……         

Read More

8254 Control Word and Operating modes

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 8K+ Views

Here we will see the control words and the operation modes of the 8254 programmable interval timer chip.Before discussing its operating modes and control word properties, we should know about some important facts of this chip.When the chip is powering up, the state is undefined. The mode, count value, and outputs are undefined in that time.Each counter must be programmed before it is used. We do not need to program some unused counters.Counters are programmed by writing the control words and then one initial count.The structure of the counter is like this -76543210SC1SC0RW1RW2M2M1M0BCD/Binary We can select the counter by the SC1 ...

Read More

Combine MySQL UPDATE STATEMENTS?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 315 Views

You can use a CASE statement for this. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Name varchar(20)    ); Query OK, 0 rows affected (1.11 sec)Insert records in the table using insert command −mysql> insert into DemoTable(Name) values('John'); Query OK, 1 row affected (0.23 sec) mysql> insert into DemoTable(Name) values('Carol'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable(Name) values('David'); Query OK, 1 row affected (0.13 sec)Display all records from the table using select statement −mysql> select * from DemoTable;This will produce the following ...

Read More

8085 program to add even parity to a string of 7 bit ASCII characters.

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 763 Views

Here we will see how to add even parity to 7-bit ASCII string using 8085.Problem StatementWrite a program to add even parity to a string of 7 bit ASCII characters. The length of the string is in memory location 8040 H and the string itself begins at memory location 8041 H. Place even parity in the most significant bit of each character.Discussion8085 has parity flat. that flag will be used to check and assign parity with each ASCII character. At first we will clear the most significant bit by masking the number with 7FH. Then use OR instruction, as this ...

Read More

8085 program for running light with delays using lookup table.

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 1K+ Views

Here we will see how we can implement running light with some delays using 8085.Problem StatementWrite 8085 program to implement running light display with appropriate delays using lookup table stored from memory location 8100H on words.DiscussionThe patterns are stored at location 8100 onwards. We are using 8255 port IC to display the content in LED displays. After displaying, it calls the delay to wait for some time and call the next byte from memory to display. So the display pattern will be like below - ProgramAddressHEX CodesLabelsMnemonicsComments800031, 00, 82START:LXI SP, 8200 HInitializing the SP80030E, 15 MVI C, 14 HInitializing the counter800521, 00, ...

Read More

8085 program to add two consecutive bytes of an array

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 893 Views

Here we will see how we can add two consecutive elements in an array using 8085.Problem StatementWrite 8085 program to add two consecutive elements of an array and store them in the same location. The carry will be placed at bottom of the other byte. The numbers are stored from location 8001. The size of array is stored at 8000.DiscussionHere we will solve this problem by using one subroutine. That will add two consecutive numbers and stored them into correct position. That subroutine will be called multiple times to add all consecutive pairs. The task will be followed half of ...

Read More

Check a column for unique value in MySQL

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 560 Views

You can use subquery for this. Let us first create a demo tablemysql> create table uniqueBothColumnValueSameDemo    -> (    -> UserId int,    -> UserValue int    -> ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into uniqueBothColumnValueSameDemo values(10, 20); Query OK, 1 row affected (0.21 sec) mysql> insert into uniqueBothColumnValueSameDemo values(10, 20); Query OK, 1 row affected (0.09 sec) mysql> insert into uniqueBothColumnValueSameDemo values(20, 30); Query OK, 1 row affected (0.10 sec) mysql> insert into uniqueBothColumnValueSameDemo values(20, 40); Query OK, 1 row affected ...

Read More
Showing 581–590 of 810 articles
« Prev 1 57 58 59 60 61 81 Next »
Advertisements