Extra Problems Worksheet (Answers at End)

1. Convert the following:

Base 2/8/16 / Decimal
101111012
1110011112
3778
7568
D816
3EC16
Decimal / Binary / Octal / Hexidecimal
19910
33510

2. Do the following binary operations (unsigned numbers):

1 0 1 0 1 0 1 0

+ 0 1 1 0 - 0 1 1 0

1 0 1 1 0 0 1 1 1 0 1 1 0 0 1 1

AND 0 1 1 1 0 1 0 1 XOR 0 1 1 1 0 1 0 1

Hex value after rotating A4 left 3 bits?

Hex value after arithmetic shifting B2 right 2 bits?

3. Fill in the following ASCII text chart:

Text / Binary ASCII / Octal ASCII / Hex ASCII
M+5
130 117 122 / 58 4F 52

4. Convert the following decimal numbers to signed 8-bit numbers:

Decimal Numbers: / -68 / -91
Sign/magnitude
1's complement
2's complement

5. What range of values can be represented using a:

a) 6-bit unsigned number to ______

b) 6-bit sign/magnitude number to ______

c) 6-bit 2's complement number to ______

6. Perform the indicated operations on these 2's complement signed 6-bit values. Check your answers by converting to decimal. Circle unrepresentable values.

0 0 1 0 1 0 1 1 0 0 1 0 1 0 1 1 0 1

+0 0 1 1 0 1 +1 0 0 1 0 0 +0 1 0 1 1 1

0 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 0 1

-0 0 1 0 1 1 -1 0 1 1 0 0 -0 1 0 0 1 1

7. Convert the following numbers:

Decimal Number / Floating Point Representation
44.187510
-319.562510
10 / 0 10000111 11101011000000000000000
10 / 1 01111101 11000000000000000000000

8. Add floating point numbers 4.625 and 5.5625.

9. Multiply floating point numbers 32.5 and 2.25

10. Use Booth's Algorithm to multiply 12 x –12 using 5-bit signed integers.

ANSWERS

1.

101111012 / 18910
1110011112 / 46310
3778 / 25510
7568 / 49410
D816 / 21610
3EC16 / 100410
Decimal / Binary / Octal / Hexidecimal
19910 / 11000111 / 307 / C7
33510 / 101001111 / 517 / 14F

2. 1 0 1 0 1 0 1 0

+ 0 1 1 0 - 0 1 1 0

1 0 0 0 0 0 1 0 0

1 0 1 1 0 0 1 1 1 0 1 1 0 0 1 1

AND 0 1 1 1 0 1 0 1 XOR 0 1 1 1 0 1 0 1

0 0 1 1 0 0 0 1 1 1 0 0 0 1 1 0

Hex value after rotating A4 left 3 bits?

A4 = 10100100

Rotate à 00100101

Convert back to hex = 25

Hex value after arithmetic shifting B2 right 2 bits?

B2 = 10110010

ASH à 11101100

Convert back to hex = EC

3.

Text / Binary ASCII / Octal ASCII / Hex ASCII
M+5 / 1001101 0101011 0110101 / 115 53 65 / 4D 2B 35
XOR / 1011000 1001111 1010010 / 130 117 122 / 58 4F 52

4.

Decimal Numbers: / -68 / -91
Sign/magnitude / 11000100 / 11011011
1's complement / 10111011 / 10100100
2's complement / 10111100 / 10100101

5. Range for 6-bit unsigned: 0 to 63

Range for 6-bit sign/magnitude: -31 to 31

Range for 6-bit 2's complement: -32 to 31

6.

0 0 1 0 1 0 (+10) 1 1 0 0 1 0 (-14) 1 0 1 1 0 1 (-19)

+0 0 1 1 0 1 (+13) +1 0 0 1 0 0 (-28) +0 1 0 1 1 1 (+23)

0 1 0 1 1 1 (+23) (-42) 0 0 0 1 0 0 ( +4)

(-42) unrepresentable

0 1 1 1 1 0 (+30) 1 1 1 1 1 0 ( -2) 1 1 1 0 0 1 ( -7)

-0 0 1 0 1 1 (+11) -1 0 1 1 0 0 (-20) -0 1 0 0 1 1 (+19)

0 1 0 0 1 1 (+19) 0 1 0 0 1 0 (+18) 1 0 0 1 1 0 (-26)

7.

44.187510 / 101100.0011 ==> 0 10000100 01100001100000000000000
-319.562510 / -100111111.1001 ==> 1 10000111 00111111100100000000000
49110 / 0 10000111 11101011000000000000000 ==> 1.11101011 x 28
-0.437510 / 1 01111101 11000000000000000000000 ==> -1.11 x 2-2

8. Add: 4.625 + 15.5625 = 20.1875

Convert to binary:

4.625 = 100.101

15.5625 = 1111.1001

Normalize:

1.00101 x 22

1.1111001 x 23

Align decimal points:

0.100101 x 23

1.1111001 x 23

Add:

0.1001010

1.1111001

------

10.1000011 x 23

De-normalize:

10100.0011

Convert back to decimal:

20.1875

9. Multiply 32.5 x 6.25 = 203.125

Convert to binary:

32.5 = 100000.1

6.25 = 110.01

Normalize:

1.000001 x 25

1.1001 x 22

Add exponents:

5 + 2 = 7

Multiply significands:

1.000001 x 1.1001 = 1.1001011001

Combine Results:

1.1001011001 x 27

Remove exponent:

11001011.001

Convert to decimal

203.125

10. Booth's Algorthim: 12 x -12

Multiplier = 12 (decimal) = 01100 (5-bit binary)

Multiplicand = -12 (decimal) = 10100 (5-bit binary 2’s complement)

Initial Product = Multiplier w/five leading zeros (for 5-bit operands)

00000 01100

(1a) Always use 0 as your initial previous LSB (pLSB). That means

the LSB & previous LSB above are 00, so there is no arithmetic

operation (no-op).

(1b) ASR

00000 00110 0

(2a) LSB and pLSB above are again 00 - no-op

(2b) ASR

00000 00011 0

(3a) LSB and previous LSB above are 10 - so subtract the

multiplicand from left half:

00000 - 10100 = 01100 (with phantom borrow)

Product is now: 01100 00011

(3b) ASR

00110 00001 1

(4a) LSB and previous LSB above are 11 - no-op

(4b) ASR

00011 00000 1

(5a) LSB and pLSB above are 01 - add the multiplicand to left half

00011 + 10100 = 10111

Product is now: 10111 00000

(5b) ASR

11011 10000

We have completed 5 passes, so answer is 1101110000.

1101110000 is a negative 2’s complement number, equivalent

to -144, which is the correct product of 12 x -12.