0% found this document useful (0 votes)
65 views6 pages

Exercises W 10 11

This document discusses computer arithmetic concepts like binary, twos complement representation and arithmetic. It contains examples of adding, subtracting and converting between decimal and binary numbers in twos complement form. Multiple choice questions are also provided related to topics like overflow, range of values, conversions between number systems and division algorithm. Worked examples are shown for calculations in twos complement form and representing decimal numbers in binary formats.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views6 pages

Exercises W 10 11

This document discusses computer arithmetic concepts like binary, twos complement representation and arithmetic. It contains examples of adding, subtracting and converting between decimal and binary numbers in twos complement form. Multiple choice questions are also provided related to topics like overflow, range of values, conversions between number systems and division algorithm. Worked examples are shown for calculations in twos complement form and representing decimal numbers in binary formats.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

2022- week 10 – Computer Architecture

1-Assume numbers are represented in 8-bit twos complement


representation. Show the calculation of the following:
A)10+12

128 64 32 16 8 4 2 1

0 0 0 0 1 0 1 0

0 0 0 0 1 1 0 0

0 0 0 1 0 1 1 0

B)-10+13

128 64 32 16 8 4 2 1

0 0 0 0 1 1 0 1

1 1 1 1 0 1 1 0

0 0 0 0 0 0 1 1

C)5-14=11110111
128 64 32 16 8 4 2 1

1 1 1 1 0 0 1 0
1

0 0 0 0 0 1 0 1
D) -9-15 Sol:11101000
2-Choose the correct answer:
.(43)10 ==((??)2’s
a-(43)10 )2’s (GATE 2000)
a)01010101 b)11010101 c)00101011 d)10101011
b- The 2’s complement representation of (-539)10 in hexadecimal is
a)ABE B)DBC c)DE5 d) 9E7
C- The decimal value 0.25
(a) is equivalent to the binary value 0.1
(b) is equivalent to the binary value 0.01
(d) cannot be represented precisely in binary
D- The 2’s complement representation of the decimal value –15 is
(a) 1111 (b) 11111 (c) 111111 (d) 10001
E-In 2’s complement addition, overflow occurs
(a) is flagged whenever there is carry from sign bit addition
(b) If the sum of two positive numbers yields a negative result, the sum
has overflowed
(c) is flagged when the carries from sign bit and previous bit match
(d) None of the above
F-the unsigned (1011011)2 =( ? )10
a)63 b)91 c) 92 d)13
G-Which has the largest value?
A)(110)10
b) ( 10011011)2
c)(1111)2
d)(9A)16
e) (222)8
H- In 6 bit 2’s complement binary, what is the decimal value
represented by (100100)2s
a)-4 b)36 c)-36 d)-27 e)-28
I-For 2’s complement binary number, the range of values for 5 bit
numbers is
a)0 to 31 b) -8 to +7 c)-8 to -8 d) -15 to -15 e) -16 to +15
J-The hexadecimal representation of (657)8
a)1AF b) D78 c)D71 d)32F
K-how many kilobytes are accessible with a 23-bit address space?
A)2^23 KB B)2^23 Kb C)2^13 KB D)2^13Kb
Ans:addresses locations=2^23 bytes= 2 ^13 x 2 ^10 bytes=
2^13 Kbytes

2
3-Find the following differences using twos complement arithmetic:
a.
110011 - 111000
(110011)2s
= -(001100+1)= -(12+1)= -13
(111000)2s = -(000111+1)=-(7+1)= -8
i.e we are given -13 - -8 which is equal to -13+8=-5
110011
+ 001000
11101=-5
b.101110 - 11001100=00101110-11001100
(11001100)2s=-(00110100)=-52
Now
00101110 =46
+
00110100 =52

0110001 0 =98

c.
110011110011 - 111100001111
110011110011=-(001100001101)=-781
111100001111=-(000011110001)=-241
-781 - -241=-781 + 241=-540
110011110011
000011110001
110111100100 = -(001000011100)=-540

d.
11101000- 11000011
11000011=-(00111101)
11101000
00111101
00100101 =37
4-Represent the following twos complement values in decimal:
1101011=-21
0101101=47

3
5- Represent the following decimal numbers in both binary
sign/magnitude and twos complement using 16 bits
1) +401 2) -14
1)401
sign/magnitude form=0000 0001 1001 0001
twos complement form=1111 1110 0110 1111
2)-14
sign/magnitude form=1000 0000 0000 1110
twos complement form=1111 1111 1111 0010

6- Represent each of the following using the 8-bit two's-complement


integer representation.
a. 10
(10)=0000 1010
b. −60(10) = 1100 0100
c. −104(10) = 1001 10000
7- For the following, assume a six-bit two's-complement
representation of integers.
a. What numeric value does 110110 represent? = -10
b. What numeric value does 010101 represent?= 21
c. What bit pattern is used to represent −12(10)? = 110100
8. What is the smallest (most negative) number you can represent in
seven bits using sign magnitude representation? Give both the bit
pattern of the number and its base-10 translation.
Ans:smallest (most negative) number in 7 bit in sign magnitude format:
1 11 1111=-63

9. What is the smallest (most negative) number you can represent in


seven bits using 2’s complement representation? Give both the bit
pattern of the number and its base-10 translation.
100 0000=-(64)10

10.Using the division algorithm calculate 7ten divided by 2ten. You


should show the contents of each register on each step. Assume both
inputs are unsigned 4-bit integers.
or 0000 0111 two by 0010 two

4
5
11. Using the division algorithm, calculate 74 divided by 21. You
should show the contents of each register on each step. Assume both
inputs are unsigned 6-bit integers.

You might also like