Ass2 Comp 5201 PDF
Ass2 Comp 5201 PDF
Name: ________
ID: ___
COMP5201 Assignment 2
Fall 2020
Issued: September 29, 2020 Due: October 20,
2020
Submit electronically. No extension will be granted.
Solution:
p q r (P+q+r P/\(P+q+r
) = w )
T T T T T
T T F F F
T F F T T
F F F F F
T F T F F
F T T F F
F T F T F
F F T T F
Solution:
p q r (q<-->r) P/\(q<-->
= w r)
T T T T T
T T F F F
T F F T T
F F F T F
T F T F F
F T T T F
F T F F F
F F T F F
p q P \/ q YPQF Y~PQF
F F F Y(FFF)= Y(TFF)=
F T
F T T Y(FTF)= Y(TTF)=
F F
T F T Y(TFF)= Y(FFF)=
T F
T T T Y(TTF)= Y(FTF)=
F F
p q P /\ q YPQT
F F F Y(FFT)=
F
F T F Y(FTT)=
F
T F F Y(TFT)=
F
T T T Y(TTT)=
T
Solution:
Solution:
Af = 10*16^1+15*16^0 = 160+15=175
Afba = 10*16^3+15*16^2+11*16^1+10*16^0 = 44986
afba 51de =
10*16^7+15*16^6+11*16^5+10*16^4+5*16^3+1*16^2+13*16^1+14*16^0 =
2948223454
Solution:
2|6 0
2|3 1
2|1 1
0
Read from bottom to top: 6 is 110 in binary.
4/9 * 2 8/9 0
8/9 * 2 16/9 1 + 7/9
7/9 * 2 14/9 1 + 5/9
5/9 * 2 10/9 1 + 1/9
1/9 * 2 2/9 0
2/9 * 2 4/9 0
4/9 * 2 8/9 0
Solution:
110.0111000111000… = 110.0111 0001 1100 0111… = 6.<71C>*
Solution:
110.01110001110001… = 1.1001 1100 0111 0001 1100 0111 0001…2^2
Solution:
Solution:
Solution:
a)
After 1 iteration Accumulator is:
00000 00000 in Hex it is 0
a)
After 1 iteration Accumulator is:
00000 11011 in Hex it is 1B
Solution:
If n=16 the largest possible FMA result is 32 bits which contains 1s,
the multiplicand and multiplier can be (2^16)-1 which contains 1s, so
in hex the largest added number can be (2^16)-1 will be ffff
1111111111111111 × 1111111111111111
= 11111111111111100000000000000001
(a+b)=Q*2^16+R
If we try on small addition tables:
N=3, a and b can be from 0 to 7.
Let a=0, b=1, then a+b = 1; 1/8 gives us q = 0 and r = 1
Let a=7, b=7, then a+b = 14; 14/8 gives us q = 1 and r = 6
So q can be either 1 or 0.
1) If a = 31,465 and r = 53,576, what are 'b' and 'q'?
31,465+b = Q*2^16+53,576
B= Q*2^16+53,576-31,465 = Q*2^16 +22,111
If Q is 0 then b =22,111
r/2^16 = 0.81750488, the equality will work if Q = 0 and b =
22,111
if Q is 1 then b = 87,647 does not work