# binary and numner system     Post on 09-Apr-2018

234 views

Category:

## Documents

Embed Size (px)

TRANSCRIPT

• 8/8/2019 Binary and Numner System

1/53

DIGITAL DESIGNDIGITAL DESIGNTHIRD EDITIONTHIRD EDITION

M. MORRIS MANOM. MORRIS MANO

CHAPTER 1 : BINARYCHAPTER 1 : BINARYSYSTEMS PROBLEMSSYSTEMS PROBLEMS

• 8/8/2019 Binary and Numner System

2/53

1.11.1--) List the octal and the hexadecimal numbers) List the octal and the hexadecimal numbers

from 16 to 32. Using A and B for the last twofrom 16 to 32. Using A and B for the last two

digits, list the numbers from 10 to 26 in base 12digits, list the numbers from 10 to 26 in base 12 ..

Octal :16 = 8 x 2 + 8 x 0 => (16)10 = (20)8

32 = 8 x 4 + 8 x 0 => (32)10 = (40)8

20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 40

• 8/8/2019 Binary and Numner System

3/53

16 = 16 x 1 + 16 x 0 => (16)10 = (10)16

32 = 16 x 2 + 16 x 0 => (32)10 = (20)8

10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B , 1C, 1D, 1E, 1F, 20

Base-12 :

10 = 12 x A => (10)10 = (A)12

26 = 12 x 2 + 12 x 2 => (26)10

= (22)12

A, B, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 20, 21, 22

• 8/8/2019 Binary and Numner System

4/53

1.21.2--) What is the exact number of bytes in a) What is the exact number of bytes in a

system that contains (a) 32K byte, (b)64M bytes,system that contains (a) 32K byte, (b)64M bytes,

and (c)6.4G byteand (c)6.4G byte ??

(a) 32K byte:

1K = 2 = 1,024

32K = 32 x 2 = 32 x 1,024 = 32,768

32K byte = 32,768 byte

• 8/8/2019 Binary and Numner System

5/53

(b) 64M byte:

1M = 2 = 1,048,576

64M = 64 x 2 = 64 x 1,048,576 = 67,108,864

64M byte = 67,108,864 byte

(c) 6.4G byte:

1G = 2 = 1,073,741,824

6.4G = 6.4 x 2 = 6.4 x 1,073,741,824 = 6,871,747,674

6.4G byte = 6,871,747,674 byte

• 8/8/2019 Binary and Numner System

6/53

1.31.3--) What is the largest binary number that can) What is the largest binary number that can

be expressed with 12 bits? What is the equivalentbe expressed with 12 bits? What is the equivalent

Binary:

(111111111111)2

Decimal:

(111111111111)2 = 1x 2+ 1 x 2 + 1 x 2 +..+ 1 x 2 + 1 x 2

(111111111111)2 = 4,095

(1111 1111 1111)2

F F F

(FFF)16=

• 8/8/2019 Binary and Numner System

7/53

1.41.4--) Convert the following numbers with the) Convert the following numbers with the

indicated bases to decimal : (4310)indicated bases to decimal : (4310)55 , and (198), and (198)1212

..

(4310)5 = 0 x 5 + 1 x 5 + 3 x 5 + 4 x 5 = 0 + 5 + 75 + 500

(4310)5 = 580

(198)12 = 8 x 12 + 9 x 12 + 1 x 12 = 8 + 108 + 144

(198)12 = 260

• 8/8/2019 Binary and Numner System

8/53

1.51.5--) Determine the base of the numbers in each) Determine the base of the numbers in each

case for the following operations to be correct :case for the following operations to be correct :

(a) 14/2 = 5 ; (b) 54/4 = 13 ; (c) 24+17 = 40 .(a) 14/2 = 5 ; (b) 54/4 = 13 ; (c) 24+17 = 40 .

(a) (14)a / (2)a = (5)a (4 x a + 1 x a) / (2 x a) = 5 x a

(4 + a) / 2 = 5

4 + a = 10

a = 6

• 8/8/2019 Binary and Numner System

9/53

(b) (54)b / (4)b = (13)b (4 x b + 5 x b) / (4 x b) = 3 x b + 1 x b

(4 + 5b) / 4 = 3 + b

4 + 5b = 12 + 4b

b = 8

(4 x c + 2 x c) + (7 x c + 1 x c) = 4 x c

4 + 2c + 7 + c = 4c

c = 11

(c) (24)c + (17)c = (40)c

• 8/8/2019 Binary and Numner System

10/53

1.61.6--) The solution to the quadratic equation x) The solution to the quadratic equation x --

11x + 22 = 0 is x=3 and x=6. What is the base11x + 22 = 0 is x=3 and x=6. What is the baseof the numbers?of the numbers?

x - 11x + 22 = (x 3) . (x 6)

x - 11x + 22 = x - (6 + 3)x + (6.3)

(11)a = (6)a + (3)a

1 + a = 6 + 3

a = 8

• 8/8/2019 Binary and Numner System

11/53

1.71.7--) Express the following numbers in decimal :) Express the following numbers in decimal :

(10110.0101)(10110.0101)22 , (16.5), (16.5)1616 , (26.24), (26.24)88 ..

(1 0 1 1 0 . 0 1 0 1 )24 3 2 1 0 -1 -2 -3 -4

(10110.0101)2 = 2 + 4 + 16 + (1/4) + (1/16)

(10110.0101)2= 22.3125

= 2 + 2 + (2^4) +(2^-2) + (2^-4)

• 8/8/2019 Binary and Numner System

12/53

(1 6 . 5 )16

1 0 -1

(16.5)16 = 6 + 16 + (5/16)

(16.5)16 = 22.3125

(2 6 . 2 4 )8

1 0 -1 -2

(26.24)8 = 6 + 16 + (2/8) + (4/64)

(26.24)8 = 22.3125

= 6 x16 + 1x16 + 5 x(16^-1)

= 6 x8 + 2x8 + 2x(8^-1) + 4 x(8^-2)

• 8/8/2019 Binary and Numner System

13/53

1.81.8--) Convert the following binary numbers to) Convert the following binary numbers to

hexadecimal and to decimal : (a) 1.11010 , (b)hexadecimal and to decimal : (a) 1.11010 , (b)

1110.10 . Explain why the decimal answer in (b)1110.10 . Explain why the decimal answer in (b)

is 8 times that of (a) .is 8 times that of (a) .

(a) (1 . 1101 0 )2= (1 . D )16 = 1x16 + Dx(16^-1)

1 D 0 0 -1

• 8/8/2019 Binary and Numner System

14/53

• 8/8/2019 Binary and Numner System

15/53

(a)(a) 1.101.10--) Convert the decimal number 345 to) Convert the decimal number 345 to

binary in two ways :binary in two ways :

Convert directly to binary;Convert directly to binary;

faster ?faster ?

• 8/8/2019 Binary and Numner System

16/53

(345)10Number Divided by 2 Remainder

345 345/2=172 1

172 172/2=86 0

86 86/2=43 0 43 43/2=21 1

21 21/2=10 1

10 10/2=5 0

5 5/2=2 1

2 2/2=1 1

Method 1:

• 8/8/2019 Binary and Numner System

17/53

Method 2:

Number Divided by 16 Remainder

345 345/16=21 9

21 21/16=1 5

(345)10=(159)16 (1 101 1001)2

• 8/8/2019 Binary and Numner System

18/53

1.111.11--) Do the following conversion problems :) Do the following conversion problems :

(a) Convert decimal 34.4375 to binary .(a) Convert decimal 34.4375 to binary .

(b) Calculate the binary equivalent of 1/3(b) Calculate the binary equivalent of 1/3

out to 8 places.out to 8 places.

Then convert from binary to decimal. HowThen convert from binary to decimal. How

close is theclose is the

result to 1/3 ?result to 1/3 ?

(c) Convert the binary result in (b) into(c) Convert the binary result in (b) into

convert the result to decimal . Is the answerconvert the result to decimal . Is the answer

the same ?the same ?

• 8/8/2019 Binary and Numner System

19/53

(a) 34.4375

34 0.4375

34:2=17 r=0

17:2=8 r=1

8:2=4 r=0

4:2=2 r=0

2:2=1 r=0

34=(100010)2

0.4375*2=0.875 r=0

0.875*2=1.75 r=10.75*2=1.5 r=1

0.5*2=1.0 r=1

0*2=0 r=0

0.43

75=(0.01110)2

34.4375=(100010.01110)234.4375=(100010.01110)2

• 8/8/2019 Binary and Numner System

20/53

(b) 1/3=0.3333

0.33333*2=0.66666 r=0

0.66666*2=1.33332 r=1

0.33332*2=0.66664 r=0

0.66664*2=1.33328 r=1.

.

.0.3333=(0.010101.)=0+ +0+

1/8 +0+ 1/32 + =~0.33333

• 8/8/2019 Binary and Numner System

21/53

(c)

0.010101010=0.0101 01010101

(0.555..)16=5/16 +5/256 +5/4096 +=~0.33203

• 8/8/2019 Binary and Numner System

22/53

1.121.12--) Add and multiply the following numbers) Add and multiply the following numbers

withoutwithoutconverting them to decimal.converting them to decimal.

(a) Binary numbers 1011 and 101 .(a) Binary numbers 1011 and 101 .

(b) Hexadecimal numbers 2E and 34 .(b) Hexadecimal numbers 2E and 34 .

(a) 1011 (11) 1011(11)(a) 1011 (11) 1011(11)

101 (5) 101(5)101 (5) 101(5)

+__________ x_____+__________ x_____

10000(16) 101110000(16) 1011

00000000

+ 1011+ 1011

__________________

110111 (55)110111 (55)

• 8/8/2019 Binary and Numner System

23/53

(b)

2E (46) 2E34 (52) 34

+____ x____

62 (98) B88A

+____

958(2392)

• 8/8/2019 Binary and Numner System

24/53

1.131.13--) Perform the following division in binary :) Perform the following division in binary :

10111111011111 101 .101 .

(1011111)2=95

(101)2=5

95/5=19 (10011)2

1011111 101101 10011000111

101

0101

101

0000

• 8/8/2019 Binary and Numner System

25/53

1.141.14--) Find the 9s) Find the 9s-- and the 10sand the 10s--complement ofcomplement of

the following decimal numbers :the following decimal numbers :(a) 98127634 (b) 72049900 (c) 10000000 (d)(a) 98127634 (b) 72049900 (c) 10000000 (d)

00000000 .00000000 .

9s comlements :

(a) 99999999-98127634=01872365

(b) 99999999-72049900=27950099(c) 99999999-10000000=89999999

(d) 99999999-0000000=99999999

• 8/8/2019 Binary and Numner System

26/53

10s complements

(a)100000000- 98127634= 01872366

(b)100000000-72049900=27950100

(c)100000000-10000000=90000000(d)100000000-0000000=00000000

• 8/8/2019 Binary and Numner System

27/53

1.151.15--) (a) Find the 16s) (a) Find the 16s--complement of AF3B .complement of A

Recommended