Tutorial exercises #2: Some basics of machine organization
QUESTION 1
Design a circuit for a decoder. A decoder takes n bits of input and generates
2^n bits of output. The output bits are numbered 0 to (2^n)-1. Output bit k
should be one if the input bits equal k in binary; otherwise, it should be
zero. Design the circuit for n=2. Write down the circuit design as a set of
boolean equations. Call the input bits i0 and i1 with i0 being the more
significant, and call the output bits o0, o1, o2 and o3.
QUESTION 2
Design a multiplexer circuit. A multiplexer takes n bits of control input bits
and 2^n bits of data input bits, and generates a single output data bit.
The output is a copy of one of the data input bits; the binary value of the
control input bits selects which one. First, design the circuit for n=2 using
boolean equations using the usual boolean gates: AND, OR and NOT. Then
see whether you can make the circuit smaller by using tristate gates.
A tristate gate has a control input and a data input, and a data output.
If the control input is one, the gate connects the data input and the data
output; if the data input is one, so is the data output, and if the data input
is zero, so is the data output. However, if the control input is zero,
then the data input and the data output are NOT CONNECTED, so the value
of the output bit will have to be computed by another circuit. You can
write down a tristate gate as "connect signal1 to signal2 if signal3".
QUESTION 3
How many different ISAs (instruction set architectures) have you heard of?
How many of these ISAs were actually implemented by computers you have used?
QUESTION 4
How can the CPU control unit use the datapath shown in lectures to increment
the value in the PC register to point to the next instruction?
QUESTION 5
How do you think constants that don't fit into 16-bit immediates should be
loaded into registers in MIPS assembly language programs?