



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Instructions and problems for lab 3 of the bme303 course in spring 2008. Students are required to complete binary addition problems using 2's complement format and identify overflow. The document also includes problems for converting decimal and hexadecimal numbers to binary and vice versa.
Typology: Lab Reports
1 / 7
This page cannot be seen from the preview
Don't miss anything!




BME303Spring Lab
LastName:
AqorVr€
FirstName:P.Jf rc\1cl.
Instructlons:
l. Usethe tlrst pageot this documentas the coverpage.
[
points
arededuct€dotherwise].
(it canbe handwritten).
canbe donementally.
Probleml[4+2=
a) You havsa 4 bit computer,i.e. a computerthat can onlydo 4 bit binary
arithm€tic and everythingbeyondthe 4rhbit cannotbe r€presented.
Complet€theIollowingadditiontablswh€re
you
addthe binarynumberin
the irhcolumnwith lhe jrhrow. The numbers are reprssont€dusing2's
complementtormat.An exampleis
given to gel
youstarted.
lal
0011 nll^ a00l 6oot) I
0111 <Ia-ii-r /ll Orr'l) at6 |
111'16', Al hn lol DI
IOOI
.oooo,
b) ls ther6"ahoverflowin someadditions
(circl€ if any)
Prcblem 212+2+2+
= 8l
In the followingtable,the 1'rcolumnrapresents a bit
pattern on an 8 bit computer
(i.o.anything boyondI bitsis notr6pr€s€nted).
ColumnA: Writeth6 1'scomplementof th€ initialbit
pattern.
ColumnB: Writethe 2's complementof the initialbit
pattern.
ColumnC: Writeth6 2's compl€m€nt of
the numberin
ggUIn[E!.
ColumnD; Writotho addilionot thenumbersin mlumnsB andC.
lnitialPattern c D
11111111 c]coa) o<r:x) AOOO (f,)a\
ll
0011 001t loo llol
10101010
.i rat I OtOl ntn t nt lr) I rrln l6lO
^Oka no^^
,'{r..) ffi oa
1
BME303Spring
Problem
+r
Lab3'
I C)
(:) o
o
() o
()
=
!ti-'-
Decimal
Add
the lollowingtwo'scomDlement
numbersand express
the answersin
borhbinaryand
decir"i,(J.F
?1,*"Jjt"vided
foryour
convenience)
Problem4 [4]
Calculat€the resultsof the tollowing
arithmeticoperations
on 16-bit2's
complementnumbors.
The numbersare
encodedin hexadocimal,
as indicated
by the prefix "0x".You
maydo the
calculations
in binary,decimalor hex,but
convert
youranswer to hoxadecimal
Statewhelher
overflowhasoccurred
(circle
one),
'Arl''!'l
OxO
Answer:
ild
l{
'-r\
la:\
10000001 ar L I lo
'
1111 a lo 1
-OCr{,
o{crl ooo i
"r:DO
C0 Oa
01100001
":t
I A
(fr('l
\a\14 o-aa
10001000
.l t11.)l
'}ri
i i croo I (j.a I aa
-.2D dC-)C
Circleone:
lhgtrOt
overflow
,--'-=7:-'>
.-'no
Ovemow ,j''
(
_-,
''
Problem 5 [3+3+3+
= 18]
a. Whaa
is the minimal
numberot bits
neededto represent
the foliowing
2's
complement
numberswrittenin hexadecimal
format
("0x" is the prefixthat
indicates
the hexadecimal
format):
\OO J/
,J., d,.,r s
o,nglerrLaT
/ zr'rrYt fI
I i
BME303Spring 2008
ProblemS[4+4+4+4=15]
c) 2048
dJ -114.
Lab 3
indthe equivalentIEFE754floating
pointrepresentationfor thedecimal
numbersbelow.
?
'r'
lltoto
a) -0.12 ,.
t-llt/Otc,tOLo''tu,t
..,-l
h)653--.V---/ b) 65.
gaain.
lem 9 [2+2+2+2+2=10]
Computethelollowing
logicoperations.Writeyourresults
in binary.
(Youcan
usethelablesto facilitate
thecalculations,butyoudon'thaveto)
a) 10101010AND
b) 00111101OR
c)
1')
((
o
,'
)
A lrgjL
{-
.:llrJ
3^
';,; t
4
h:,"0,
BME303Spring
p(
(Addmore
l.Po\ 7)9!):
'-.-l
I
1t
ab
/,
to
^-.J-A-
lJl,.t',V
o
l
? !11Ju-*{-(
7 l'y.'v
rn!!*
,., t
Problem
Fillup
the blanksin thetruthtablswithsuitable
valuos.
output'l= NOT(Y)
output2= Y AND(X OR
Output
r,.
ilgi
^i'l
il
it
I
o
o
o
o
,i
o o I I a a l
)a
z NOT
z
oRz
z
z)
NoT(z)
a
o c
n
1 o
() L
o C)
0 1 0 0 a
(,
o
' I
D
t)
o o
o o
,
0 0 o
o
a o
()
1 0 1 o
a
() o a
o
a
1
1 0 o
o o O
o
'
1 1
(
a o
I
o
t )Dt