Homework #1 - NCNU Moodle 課程

Homework #1
1.4 What is the largest binary number that can be expressed with 16 bits? What are the
equivalent decimal and hexadecimal numbers?
16-bit binary:
Decimal:
Hexadecimal:
1111 1111 1111 1111
216 − 1 = (65535)10
(FFFF)16
1.5 Determine the base of the numbers in each case for the following operations to be
correct:
(a) 14/2 = 5 (b) 54/4 = 13 (c) 24 + 17 = 40.
Let B = base,
(a) (1xB + 4)/2 = 5  1xB + 4 = 2x5 = 10  B = 6
(b) (5xB + 4)/4 = 1xB + 3  5xB + 4 = (1xB + 3)x4 = 4xB + 12  B = 8
(c) (2xB + 4) + (1xB + 7) = 4xB + 0  3xB + 11 = 4xB  B = 11
1.8 Convert the decimal number 431 to binary in two ways: (a) convert directly to binary;
(b) convert first to hexadecimal and then from hexadecimal to binary.
(a) 431 repeated division by 2  1 1010 1111
(b) 431 repeated division by 16 1AF  1 1010 111
116 = 00012
A16 = 10102
F16 = 11112
NCNU_2016_DD_1_1
1.10 Convert the following binary numbers to hexadecimal and to decimal:
(a) 1.10010, (b) 110.010.
(a) 1.1001 0  1.9016 1+ 9/16 = 1.562510
(b) 110.010  6.416  6 + 4/16 = 6.2510
1.22 Convert decimal 6,514 to both BCD and ASCII codes. For ASCII, an even parity bit
is to be appended at the left.
6514  (0110 0101 0001 0100)BCD
6
5
1
4
6514  (0011 0110 0011 0101 1011 0001 1011 0100)ASCII
6
5
1
4
1.xx Complete the truth table for the logic circuit shown below.
A
x
z
B
C
y
A B C x y z
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
1
1
0
0
0
0
0
0
1
1
1
0
1
1
1
0
0
0
1
0
1
1
1
0
NCNU_2016_DD_1_2