Presentation is loading. Please wait.

Presentation is loading. Please wait.

Exercises 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy 1 Logic Design (CE1111 )

Similar presentations


Presentation on theme: "Exercises 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy 1 Logic Design (CE1111 )"— Presentation transcript:

1 Exercises 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy 1 Logic Design (CE1111 )

2 Exercise 1  Convert the following binary numbers to octal and hexadecimal numbers 1. (10010110) 2 = (226) 8 =(96) 16 2. (110010100) 2 = (624) 8 =(194) 16 3. (101001101) 2 = (515) 8 =(14D) 16 4. (1001.100101011010) 2 = (11.4532) 8 =(9.95A) 16 5. (11001.101011) 2 = (31.53) 8 =(19.AC) 16 6. (101110.110) 2 = (56.6) 8 =(2E.C) 16

3 Exercise 2  Convert the following octal and hexadecimal numbers to binary numbers 1. (234) 8 =(10011100) 2 2. (4FA2) 16 =(100111110100010) 2 3. (5B23.AD67) 16 =(101101100100011.1010110101100111) 2 4. (3721.421) 8 =(11111010001.100010001) 2

4 Exercise 3  Convert the hexadecimal number 64CD to binary, and then convert it from binary to octal (110010011001101) 2 =(62315) 8  Convert the decimal number 431 to binary in two ways: 1. Convert directly to binary= (110101111) 2 2. Convert first to hexadecimal and then from hexadecimal to binary=(1AF) 16 =(110101111) 2 Which method is faster? Way (1) is faster

5 Exercise 4  Find the 9’s and the 10’s complement of the following decimal numbers: 1. 25,478,036 = (74521963) 9’scomplement = (74521964 ) 10’scomplement 2. 63, 325, 600 = (36674399) 9’scomplement = (36674400 ) 10’scomplement 3. 25,000,000 = (74999999) 9’scomplement = (75000000 ) 10’scomplement 4. 00,000,000 = (99999999) 9’scomplement = (100000000 ) 10’scomplement

6 Exercise 5  Obtain the 1’s and 2’s complements of the following binary numbers: 1. (00010000) 2 =(11101111) 1’s complement =(11110000) 2’s complement 1. (00000000) 2 =(11111111) 1’s complement =(00000000) 2’s complement 1. (11011010 ) 2 =(00100101) 1’s complement =(00100110) 2’s complement 1. (10101010) 2 =(01010101) 1’s complement =(01010110) 2’s complement 1. (10000101) 2 =(01111010) 1’s complement =(01111011) 2’s complement 1. (11111111) 2 =(00000000) 1’s complement =(00000001) 2’s complement

7 Exercise 6 Perform subtraction on the given unsigned binary numbers using the 2’s complement of the subtrahend: 1. 10011 - 10010 =0001 2. 100010 – 100110= – 000100(negative number) 3. 1001 – 110101= – 101100(negative number) 4. 101000 – 10101=010011

8 Exercise 7 Perform the mathematical operations on the given signed numbers using the 2’s complement for negative numbers and subtraction operation 1. (+3) + (+5)=(0000 1000) 2 2. +16 – (+13)=(0000 0011) 2 3. +8 – (– 4)=(00001100) 2 4. (– 9) – (+5)=(10001110) 2

9 Exercise 8  Represent the unsigned decimal numbers 791 and 658 in BCD 791=(0111 1001 0001) BCD, 658=(0110 0101 1000) BCD  Convert decimal 6,514 to both BCD and ASCII codes 6,514 =(0110 0101 0001 0100) BCD =(0110110 0110101 0110001 0110100) ASCII  Represent the decimal number 6,248 in 1. BCD=(0110 0010 0100 1000) 2. excess ‐ 3 code=(1001 0101 0111 1011) 3. 2421 code=(1100 0010 0100 1110) 4. 8,4,-2,-1 Code= (1010 0110 0100 1000) 5. Gray Code= (0101 0011 0110 1100)

10 Useful website  http://coderstoolbox.net/number/ http://coderstoolbox.net/number/  http://www.rapidtables.com/math/number/Numeral_syst em.htm http://www.rapidtables.com/math/number/Numeral_syst em.htm  http://www.electrical4u.com/digital-electronics/ http://www.electrical4u.com/digital-electronics/  http://atozmath.com/NumberSubComp.aspx http://atozmath.com/NumberSubComp.aspx  http://www.unit-conversion.info/texttools/ascii/ http://www.unit-conversion.info/texttools/ascii/


Download ppt "Exercises 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy 1 Logic Design (CE1111 )"

Similar presentations


Ads by Google