Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Walker
September 15, 2018
dn ∗ B n + dn−1 ∗ B n−1 + · · · + d2 ∗ B 2 + d1 ∗ B 1 + d0
10213 ⇒ base10
=⇒ 1 ∗ 3 + 0 ∗ 3 + 2 ∗ 31 + 1 ∗ 30
3 2
= 27 + 0 + 6 + 1
= 3410
c) 461148 to base16 using the fact that these are related bases.
4611488 ⇒ base16
=⇒ 100 110 001 001 1002
=⇒ 0100 1100 0100 11002
= 4C4C16
335510 ⇒ base9
=⇒ 372 41 4 0
9 3355 9 372 9 41 9 4
2700 360 36
655 12 5
630 9
25 3
18
7
= 45379
1
e) 10356 to base7 using any method.
10356 ⇒ base10
=⇒ (((6 ∗ 1 + 0) ∗ 6 + 3) ∗ 6 + 5)
= 23910
base10 ⇒ base7
34 4 0
7 239 7 34 7 4
210 28
29 6
28
1
= 4617
(carry) 1 1 1 1 1
0 0 0 0 1 1 0 0 0 1 0 0 1 1 1 12 Addend
+ 0 0 0 0 1 0 0 0 1 0 1 0 1 1 0 12 Augend
0 0 0 1 0 1 0 0 1 1 1 1 1 1 0 02 Sum
(carry) 10 1 Z
Z 10 1 10 10
0 1 1
A 0 0 0 1A 0 0 1 1 1 12 Minuend
+ 0 1 0 0 0 1 0 1 0 1 1 0 12 Subtrahend
0 0 0 1 1 1 0 1 0 0 0 1 02 Difference
2
4. Purely in hex, add: 4 A 0 C 8 716 + 3 0 F D 2 216
(carry) 1 1
4 A 0 C 8 716 Addend
+ 3 0 F D 2 216 Augend
7 B 0 9 A 916 Sum
(carry) 9 10F
Z 10
A 0
4 @ C 8 716 Minuend
− 3 0 F D 2 216 Subtrahend
1 9 0 F 6 516 Difference
3
6. The number below, uses 12-bit 20 s complement base2 representation, answer the following:
a) 0101 1110 10012 is this number negative? Why, or why not?
Step 1.
−x = (¬x + 1)
Step 2.
−x = (¬x + 1)
V erif y step 1.
¬(1010 0001 01112 ) + 12
= 0101 1110 10002 + 12
= 0101 1110 10012 twos compliment.
4
7. In 6 bit 2’s complement base2 , what are the largest and the smallest values which can be represented?:
a) give binary bit patterns for both values.
b) decimal numbers corresponding to each binary number from part a).
26−1 − 1
= 32 − 1
= 3110
U sing the division method gives,
15 7 3 1 0
2 31 2 15 2 7 2 32 1
20 14 6 2
11 1 1 1
10
1
−(26−1 )
= −3210
∵ | − 3210 | = 3210 ∧ 3110 = 011 1112
=⇒ 011 1112 + 1 = 100 0002 twos compliment.
8. In 6-bit 2s complement base2 are there any value(s) whose result when applying the
2’s complement negation operation does not result in a different value?
If yes, then state these value(s), in binary:
−value = ¬value + 1
V alue one
000 0002 twos compliment.
¬(000 000)2 + 1
= 111 1112 + 1
= 000 0002 twos compliment.
V alue two
100 0002 twos compliment.
¬(100 000)2 + 1
= 011 1112 + 1
= 100 0002 twos compliment.
5
9. Assuming a fixed length of 8 bits (1 byte), represent the following decimal numbers in signed magnitude base2 :
a) 3010
b) -13010
16 + 8 + 4 + 2 = 3010
∴ 3010 = 0001 11102 SM
−(2n−1 − 1)
=⇒ −(28−1 − 1)
= −(128 − 1)
= −12710
∵ (| −13010 |) > (| −12710 |)
0
−13010 can t be represented in 8 bit signed magnitude.
−(2n−1 )
=⇒ −(28−1 )
= −12810
∵ (| −13010 |) > (| −12810 |)
0
−13010 can t be represented in 8 bit twos compliment.
6
11. Assume a computer is using signed magnitude base2 representation to store 8-bit values.
Further, assume you have a program which can display the contents of 1-byte memory locations.
However, the program displays hex (as a shorthand) instead of binary.
What decimal values are represented by the following:
a) 9016
b) 7A16
P art a
9016
since,
016 = 00002 ∧ 916 = 10012
9016 = 1001 00002
however 9016 > ±12710
the sign bit can0 t be used
∴ the value does not f it.
P art b
7A16
716 = 01112 ∧ A16 = 10102
=⇒ 7A16 = 0111 10102 SM
since, the sign bit (sb) is 0 the value is positive.
7
12. Repeat the above, but assume the numbers are stored as 8-bit 2’s complement base2 :
P art a
9016
since, 916 = 10012 and 016 = 00002
=⇒ ¬(1001 00002 ) + 1
= 0110 11112 + 1
= 0111 00002 twos compliment
P art b
7A16
716 = 01112 ∧ A16 = 10102
=⇒ 7A16 = 0111 10102
since the most signif icant bit (msb) is 0 the value is positive.
Calculation done in question 11
∴ 0111 10102 two0 s compliment = 12210