Department of Mathematics, Statistics
and Computer Science
Wim Ruitenburg's MSCS 206 EX1 sample problems
Exam 1 covers, from the first book, Appendix A, Chapter 1, Chapter 2, and from
Chapter 3 the sections 3.1 and 3.2.
- Sketch how to build an or gate from transistors.
- Sketch how to build an and gate from transistors.
- Sketch how to build a xor gate from transistors.
- Show how to build an and gate using only nand gates.
- There are 4 different Boolean functions possible with one binary input
variable A, namely F = 0, F = 1, F = A, and F = -A. How many different Boolean
functions are possible with two binary input variables A and B (don't list
them; I want their number and how you got this total number). The same question
for Boolean functions with three binary input variables A, B, and C.
- Build the minority function F = (-A)(-B)C + (-A)B(-C) + A(-B)(-C)
using a 4-to-1 MUX multiplexer.
- Sketch the circuit, using logic gates, of a 2-to-4 decoder.
- Sketch the circuit, using logic gates, of a 4-to-2 priority encoder.
- Use logic gates to draw the clocked D Flip-Flop with inputs D and CLK,
and outputs Q and -Q.
- Give an example, with logic gates, of a circuit with a hazard.
- (Imagine you have a picture of the S-R flip-flop available).
Display the timing behavior of the S-R flip-flop when R or S is raised and
dropped. What is the problem with raising both S and R (the book calls that
`disallowed')?
- (Imagine you have a picture of the negative edge-triggered D flip-flop
available). Describe what happens when CLK goes from 1 to 0. Why is the
flip-flop `stable' when CLK = 0?
- Use JK flip-flops and logic gates to draw a modulo 4 ripple counter
with inputs CLK, Enable (EN) and -RESET, and outputs Q_0 and Q_1
(hint: you need only 2 JK flip-flops).
- Design a 4-bit shift register. Besides logic gates you are permitted
to use master-slave flip-flops and tri-state buffers. The componen must have
inputs D (new data bit), WR (write), CLK, Enable (only to control the 4
outputs), and Q0, Q1, Q2, and Q3 as outputs. Bits are shifted to the right.
- Consider computing the electric field in a box 100mm on a side.
The spatial resolution in each dimension is to be 0.1mm.
Assume it takes 100 instructions for every point in the 3-D grid to do the
calculation.
How long does it take a 5 MIPS computer to complete the calculation?
- A certain computer requires 25 microsec. to process each data record in
a database. The database contains 100*10^6 records. How long will processing
take? How many 1.0 MB floppies do we need for a full backup if each record is
4 bytes?
- Compare and contrast the 1-address and 0-address machine instruction
format.
- Describe how one calculates (A + B) * C on a system with a 1-address
machine instruction format.
- What is immediate addressing? Give an example.
- What is direct addressing? Give an example.
- What is indirect addressing? Give an example.
- What is register direct addressing? Give an example.
- What is register indirect addressing? Give an example.
- What is displacement (based or indexed) addressing? Give an example.
- What is relative addressing? Give an example.
- (Imagine you have the SRC instruction set from the back inside cover.)
The SRC has shr and shl instructions. Why does it also have shra?
Give a detailed answer.
- (Imagine you have the SRC instruction set from the back inside cover.)
Write the assembly version of a program that adds the contents of M[1000]
and M[1004], and stores the result in M[1008].
- (Imagine you have the SRC instruction set from the back inside cover.)
Suppose that we are given that a number x is stored in M[200].
Write the assembly version of a program that adds the contents of M[800 + x]
and M[804 + x], and stores the result in M[808 + x].
- (Imagine you have the SRC instruction set from the back inside cover.)
Write an assembly program that adds M[1004] and M[1008] and stores the
result in M[1012] if M[1000] contains the value 0; otherwise put the difference
M[1004] minus M[1008] in M[1012]. Write your program such that it is
relocatable in memory, and still runs properly.
- (Imagine you have the SRC instruction set from the back inside cover.)
Suppose a number x is stored in M[400]. Write assembly routines to do the
following:
- M[1000] <- M[M[x+R[3]]];
- M[1004] <- M[M[x]+R[3]];
- (Imagine you have the SRC instruction set from the back inside cover.)
Write an assembly program that adds M[8388608] and M[8388612], and stores the
result in M[8388616]. (This is a little tricky. Hint: 8388608 = 2^23.)
- What could go wrong when we enable 2 tri-state gates at the same time
on the same bus?
- (Imagine you have Figure 2.23 of page 80). Write the fastest possible
control sequence to perform the following abstract RTN instructions:
(R[2] <- R[0] + 1 ; R[3] <- R[0] + R[1]);
- Explain the following RISC design philosophy principles and their
relation:
- One instruction per cycle.
- Fixed instruction length.
- Only load and store instructions access memory.
Last updated: November 1998
Comments & suggestions:
wimr@mscs.mu.edu