Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Name:

Id No:

MID-TERM EXAMINATION
Introduction to Computing Systems

Class: CTTT-1 2011-2012


Friday, June 1st 2012
Time: 75 mins
Note that: This is a closed book exam (without books, laptops, )
Absolutely no interaction between students is allowed.

Problem 1: (2 points)
a) What is the 2s complement representation of -22?

b) What is the decimal value of the 2s complement representation of 10110110?

c) What is the floating-point number of 3.125 in the standard of IEEE 754?

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?

Problem 3: (2.5 points)


Design a memory of 27 KB consisting of 2 chips of 4 KB, 1 chip of 16 KB, 1 chip of 2
KB and chip of 1 KB.
Give: 1. Address table
2. Address wires for decoding.
3. Figure for decoder and all memory chips with some wires (address, data,
control signals,) needed.

Problem 4: (1.5 points)


Give a LC-3 program below
.ORIG x4000
LEA R0, M1

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

a) After being executed, what is the content of R0?

b) After being executed, what is the content of R1?

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.

You might also like