Mid-Term Examination Class: CTTT-1 2011-2012 Friday, June 1 2012 Time: 75 Mins
Mid-Term Examination Class: CTTT-1 2011-2012 Friday, June 1 2012 Time: 75 Mins
Id No:
MID-TERM EXAMINATION
Introduction to Computing Systems
Problem 1: (2 points)
a) What is the 2s complement representation of -22?
Problem 2: (2 points)
a) What range of values can be represented with a 2s complement integer consisting of
11 bits?
b) If the total size of memory is 1MB (220 Bytes), and its addressability is 32 bytes, how
many bits of address are required to address all of memory?
c) Say we have an ISA using 32-bit instructions and memory is byte addressable, by
how much must we increment the PC after fetching an instruction?
DONE
LD
R1, M1
LD
R2, M2
NOT R1, R1
ADD R1, R1, #1
ADD R3, R2, R1
BRz DONE
STR R3, R0, #0
HALT
M1
.FILL #65
M2
.FILL #66
.END
c) After being executed, what is the content of the memory location at x4009?
Problem 5: (2 points)
Write an LC-3 Assembly language program to read values of memory locations at
x4000 and x5000. Compare these values, if they are equal to each other, write 1 to the
memory location at x6000, otherwise write 0 to that memory location.
Program starts at x3000.