Você está na página 1de 8

Digital Hardware - Homework 1

1. Convert these binary numbers to decimal.

a. 101102
b. 111111112
c. 111110101112

Ans:
101102
4 3 2 1 1
2x1 + 2x0 + 2x1 + 2x1 + 2x0 =
16 + 0 + 4 + 2+ 0=
22=

111111112
7 6 5 4 3 2 1 0
2x1 + 2x1 + 2x1 + 2x1 + 2x1 + 2x1 + 2x1 + 2x1 =
128 +64 +32 +16 + 8 + 4 + 2+ 1=
255=

111110101112
10 9 8 7 6 5 4 3 2 1 0
2x1 + 2x1 + 2x1 + 2x1 + 2x1 + 2x0 + 2x1 + 2x0 + 2x1 + 2x1 + 2x1 =
1024 + 512 + 256 +128 + 64 + 0 +16 + 0 + 4 + 2+ 1=
2007=
2. Convert the following decimal values to binary.

a. 77
b. 205
c. 511

Ans:
2 77
2 38 - 1
2 19 - 0
2 9-1
2 4-1
2 2-0
1-0
(1001101)2

2 205
2 102 - 1
2 51 - 0
2 25 - 1
2 12 - 1
2 6-0
2 30
1-1
(11001101)2

2 511
2 255 - 1
2 127 -1
2 63 1
2 31 - 1
2 15 - 1
2 71
2 31
1-1
(111111111)2
3. Convert each hex number to its decimal equivalent.

a. 743
b. 2C0
c. 37FD

Ans:
74316
2 1 0
16 x7 + 16 x4 + 16 x3=
256x7 + 16x4 + 1x3=
1792 + 64 + 3=
1859=

2C016
2 1 0
16 x2 + 16 xC + 16 x0=
256x2 + 16x12 + 1x0=
512 + 192 + 0=
704=

37FD16
3 2 1 0
16 x3 + 16 x7 + 16 xF + 16 xD=
4096x3 + 256x7 + 16x15 + 1x13=
12288 + 1792 + 240 + 13=
14333=

4. Convert each of the following decimal numbers to hex.

a. 771
b. 2048
c. 25619

Ans:
16 771
16 48 - 3
3-0
(303)16

16 2048
16 128 - 0
8-0
(800)16

16 25619
16 1601 - 3
16 100 -1
6-4
(6413)16

5. Convert the binary numbers in Problem 1 to hex.

Ans:
101102
0001 0110=
1616=

111111112
1111 1111=
FF16=

111110101112
0111 1101 0111=
7D716=
6. Convert the hex values from Problem 3 to binary.

Ans:
74316
0111 0100 0011=
111010000112=

2C016
0010 1100 0000=
10110000002=

37FD16
0011 0111 1111 1101=
110111111111012=

7. Convert the binary numbers in Problem 1 to hexadecimal.

Ans:
101102
0001 0110=
1616=

111111112
1111 1111=
FF16=

111110101112
0111 1101 0111=
7D716=

8. Convert the hex values in Problem 3 to binary.

Ans:
74316
0111 0100 0011=
111010000112=

2C0
0010 1100 0000=
10110000002=

37FD
0011 0111 1111 1101=
110111111111012=

9. Using five bits, show the binary counting sequence from 00000 to 11111.

Ans:

00000
00001
00010
00011
00100
00101
00110
00111
01000
01001
01010
01011
01100
01101
01110
01111
10000
10001
10010
10011
10100
10101
10110
10111
11000
11001
11010
11011
11100
11101
11110
11111

10. List the hex numbers in sequence from 280 to 2A0.

Ans:

280
281
282
283
284
285
286
287
288
289
28A
28B
28C
28D
28E
28F
290
291
292
293
294
295
296
297
298
299
29A
29B
29C
29D
29E
29F
2A0
11. Write the binary number that results when each of the following binary numbers is incremented by one.

a. 0111
b. 010011
c. 1011

Ans:
a. 1000
b. 010100
c. 1100

12. Write the binary number that results when each of the following binary numbers is decremented by one.

a. 1110
b. 101000
c. 1110

Ans:
a. 1101
b. 100111
c. 1101

13. Write the number that results when each of the following is incremented.

a. 777916
b. 999916
c. 0FFF16
d. 200016
e. 9FF16
f. 100A16

Ans:
a. 777A16
b. 999A16
c. 100016
d. 200116
e. A0016
f. 100B16

14. Repeat Problem 13 for the decrement operation.

Ans:
a. 777816
b. 999816
c. 0FFE16
d. 1FFF16
e. 9FE16
f. 100916

15. Encode these decimal numbers in BCD.

a. 187
b. 1024
c. 89627

Ans:
a. (0001 1000 0111)BCD
b. (0001 0000 0010 0100) BCD
c. (1000 1001 0110 0010 0111)BCD
16. The following numbers are in BCD. Convert them to decimal.

a. 1001011101010010
b. 011010010101
c. 010010010010

Ans:
a. 1001 0111 0101 0010 = 975210
b. 0110 1001 0101 = 69510
c. 0100 1001 0010 = 49210

17. What is the maximum number that we can count up to using 10 bits?

Ans:
10
The maximum number that we can count up to using 10 bits is 2 1 = 1023

18. What is the largest decimal value that can be represented by a 16-bit binary number:

Ans:
16
The largest decimal value that can be represented by a 16-bit binary number is 2 1 = 65535

19. How many bits are needed to count up to a maximum number of 511?

Ans:
8
The largest decimal number of 8 bits is 2 1 = 255
9
The largest decimal number of 9 bits is 2 1 = 511

Therefore, 9-bits are needed to count up to a maximum number of 511.

20. How many bits are required to represent the decimal numbers in the range from 0 to 999 using:

a. straight binary code


b. BCD code

Ans:
a.
9
The largest decimal number of 9 bits is 2 1 = 511
10
The largest decimal number of 10 bits is 2 1 = 1023

Therefore, 10- bits are required to represent the decimal numbers in the range from 0 to 999 using
straight binary code.

b.
12- bits are required to represent the decimal numbers in the range from 0 to 999 using BCD code.

21. Answer the following:

a. How many bits are contained in eight bytes?


b. What is the largest hex number that can be represented in four bytes?
c. What is the largest BCD-encoded decimal value that can be represented in three bytes?

Ans:
a. 8 x 8 = 64 bits
b. FFFFFFFF
c. 999999

22. Answer the following:


a. What is the most significant nibble of ASCII code for the letter X?
b. How many nibbles can be stored in a 16 bit word?
c. How many bytes does it take to make up a 24-bit word?

Ans:
a. 0101
b. 16/4 = 4 nibbles
c. 24/8 = 3 bytes

23. Represent the statement "X = 3 x Y" in ASCII code. Attach an odd-parity.

Ans:
X = 3 x Y

The ASCII translation of the statement is:

58H 20H 3DH 20H 33H 20H 78H 20H 59H

01011000 00100000 00111101 00100000 00110011 00100000 01111000 00100000 01011001

Attaching an odd parity

01011000 00100000 00111101 00100000 10110011 00100000 11111000 00100000 11011001

24. Attach an even-parity to each of the ASCII codes for Problem 23 and give the results in hex.

Ans:
Attaching an odd parity

11011000 10100000 10111101 10100000 00110011 10100000 01111000 10100000 01011001


D8 A0 BD A0 33 A0 78 A0 79

25. The following bytes (shown in hex) represent a persons name as it would be stored in a computers memory.
Each byte is a padded ASCII code. Determine the name of the person.

42 45 4E 20 53 4D 49 54 48
Ans:
BEN SMITH

26. Convert the following decimal numbers to BCD code and the attach an odd parity.

a. 74
b. 8884
c. 165

Ans:
a. The BCD code is: 01110100
Attaching an odd parity:101110100

b. The BCD code is: 1000100010000100


Attaching an odd parity:11000100010000100

c. The BCD code is: 000101100101


attaching an odd parity:0000101100101

27. Suppose the receiver received the following data from the transmitter. The data was transmitted with an even
parity.
01001000
11000101
11001100
11001000
11001100

What errors can the receiver determine in these received data?

Ans:

01001000 even parity


11000101 even parity
11001100 even parity
11001000 odd parity
11001100 even parity
th
There is an error in the 4 byte since it was received with an odd parity though the data was transmitted with an
even parity.

Você também pode gostar