Marquette University

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.
  1. Sketch how to build an or gate from transistors.
  2. Sketch how to build an and gate from transistors.
  3. Sketch how to build a xor gate from transistors.
  4. Show how to build an and gate using only nand gates.
  5. 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.
  6. Build the minority function F = (-A)(-B)C + (-A)B(-C) + A(-B)(-C) using a 4-to-1 MUX multiplexer.
  7. Sketch the circuit, using logic gates, of a 2-to-4 decoder.
  8. Sketch the circuit, using logic gates, of a 4-to-2 priority encoder.
  9. Use logic gates to draw the clocked D Flip-Flop with inputs D and CLK, and outputs Q and -Q.
  10. Give an example, with logic gates, of a circuit with a hazard.
  11. (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')?
  12. (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?
  13. 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).
  14. 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.
  15. 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?
  16. 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?
  17. Compare and contrast the 1-address and 0-address machine instruction format.
  18. Describe how one calculates (A + B) * C on a system with a 1-address machine instruction format.
  19. What is immediate addressing? Give an example.
  20. What is direct addressing? Give an example.
  21. What is indirect addressing? Give an example.
  22. What is register direct addressing? Give an example.
  23. What is register indirect addressing? Give an example.
  24. What is displacement (based or indexed) addressing? Give an example.
  25. What is relative addressing? Give an example.
  26. (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.
  27. (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].
  28. (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].
  29. (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.
  30. (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:
  31. (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.)
  32. What could go wrong when we enable 2 tri-state gates at the same time on the same bus?
  33. (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]);
  34. Explain the following RISC design philosophy principles and their relation:

Last updated: November 1998
Comments & suggestions: wimr@mscs.mu.edu