Computer Architecture (V112) : Tutorial 1 - Solutions
Computer Architecture (V112) : Tutorial 1 - Solutions
Tutorial 1 – Solutions
(b) Each word is 32 bits = 4 bytes, and if main memory is byte-addressable we have 4
20 2 2 20 24
x 4 Megabytes i.e. 4 x 4 x 2 = 2 x 2 x 2 = 2
Therefore 24 bits are required to uniquely address each byte.
2 The first two bytes of a 1M x 16-bit main memory have the following hex values:
Byte 0 = FFH
Byte 1 = 01H
If these bytes hold a 16-bit twos complement integer what is its decimal value if
(a) main memory is big-endian?
(b) main memory is little-endian?
(a) Big-endian
Word 0 Byte 0 Byte 1
FF 01 hex -> rewrite in binary
1111 1111 0000 0001 is negative, therefore negate to
convert, and negate result.
Negate -> 0000 0000 1111 1111 is 255
Therefore Word 0 holds the integer –255
10
(b) Little-endian
Word 0 Byte 1 Byte 0
01 FF hex -> rewrite in binary
0000 0001 1111 1111 is 511
N.Dulay p1
3 Suppose that a 1M x 16-bit main memory is built using 256Kx8-bit RAM chips and
that memory is word-addressable.
In which bank would the fifteenth memory word (address 14) be found when the
memory system uses:
f) high-order interleave?
g) low-order interleave?
Assume banks are numbered from 0.
In which bank would the eighth memory word (address 14) be found when the memory
system uses:
b) high-order interleave?
c) low-order interleave?
Assume banks are numbered from 0.
20 1 21
a) Memory is addressed on a byte basis and 1Mx2x8bit = 2 x2 =2
Therefore 21 address bits are needed
For (b) & (c) we need to divide the address by the number of bytes in a memory word
since we have byte addressing, e.g. in this case by 2.
N.Dulay p2
5 The answers for questions 2(a) and 2(b) are different. Comment on the implications if
we wished to transfer data between a little-endian memory (e.g. on an IBM PC
computer) and a big-endian memory (e.g. on an Apple Macintosh computer) ?
For some types & sizes of data we would have to re-order the transmitted data.
Students should be able to give examples of which types of data need to be re-ordered?
N.Dulay p3