C20B Final xam, 200 Point xam Closed Book, Closed Notes, Calculators Not llowed June 2th, 2003 Name Guidelines: Please remember to write your name on your bluebook, and when finished, to staple your solutions and exam sheets together.. Please use your own paper or examination book. Number your problems clearly. You must turn in the exam sheets as well as your answers. You must use ink. Please do not write in the following box. This will be used by the graders to record their scores. Prob Score Prob Score Prob Score 6 2 7 2 3 8 4 9 5 0 5. (5 points) Be sure to read this problem all the way through before starting it. Implement a sequence recognizer with a single input X, and a single output Z. The output will be if the last four inputs are 0, and will be 0 otherwise. We will, however, use a circuit design that is different from the oneusedinclass.inournewdesign,thefour-typeflip-flops in your circuit will be used to store the last 4 values of X. For example, if the last 4 X inputs were 0, then the 4 flip-flops would store,, 0, and, respectively. ssuming that the initial values of all flip-flops are 0, and that only -type flip-flops and elementary gates (N, OR, NOT) may be used, then draw the circuit. Note that a state table or diagram is not needed to do this problem. 6. (20 points total) For this problem assume that you are given the algorithmic state chart shown in Figure 6. (a) (0 points) Complete the manual simulation shown in Figure 6B. ach column represents a clock cycle. (b) (5 points) Calculate the Boolean expressions for (t+), B(t+), and C(t+) assuming one-hot (one flip-flop per state) encoding. (c) (5 points) Implement (draw) the circuit using -type flip-flops. 7. (25 points total) We wish to design a 2-bit counter with the following inputs X Y function 0 hold count up 0 x set count to 0 (clear) (a) (5 points) enoting the state variables as Q and Q 0, fill in the state table shown in Figure 7a. In your state table include the settings for the J-K flip-flops (see part b of this problem. (b) (0 points) erive the Boolean expressions for J Q, K Q, J Q0,andK Q0 using dense encoding and J-K flip-flops. 8. (5 points total) ssume that you are given a memory chip of size 256K 64. (a) (2 points) How many words of data may be stored in the chip? (b) (2 points) What is the word length (in bits and in bytes) for the chip? (c) (2 points) How many address lines are required for the chip? (d) (2 points) How many data input lines (and output lines) are there? (e) (2 points) what is the purpose of the chip select pin?
(f) (5 points) ssume that the memory cells are arranged in a square so that two-dimensional coincident decoding is used within the chip. s in the textbook, you may assume that memory cells corresponding to a single word are contained in one row. How many of the address lines are assigned to the row decoder, and how many are assigned to the column decoder? Be sure to justify your answer. 9. (20 points) Now assume that you are given four memory chips of size 28K 32 (see Figure 9). ssume that each chip has input pins corresponding to data-in (T IN) and address (RS),asingle read-not write pin (R/W ), and a single chip-select pin (CS). ach chip also has a set of data-out pins (T OUT). Using the 4 chips and a single -to-2 decoder, show how you would construct an effective memory chip of size 256K 64. 0. (5 points) Implement (draw) the 3-input odd function F = X Y Z using only NOR gates (no other gate types, including inverters). The NOR gates can have two, three, or four inputs. It is possible to complete this problem with a total of only NOR gates.. (0 points total) ssume that you are given the two 8-bit numbers = 000000 and B = 000000. (a) (5 points) Calculate B assuming that both numbers are unsigned integers. Use the 2scomplement method to calculate the solution (show work). What are the values of and B in decimal? (b) (5 points) Calculate B assuming that both numbers are signed integers and in 2s-complement form. Be sure to show your work. What are the values of and B in decimal? 2. (4 points) Show how you would construct a 4-to-6 decoder (with enable) from five 2-to-4 decoders (see Figure 2a). For the 4-to-6 decoder label the inputs 0,, 2, 3, and, and the outputs 0 through 5 such that they satisfy the (simplified) truth table shown in Figure 2b. 2
Figure 6 Figure 6B Z 0 Y X 0 0 0 Y 0 0 0 STT Z 0 X Z B Z C X 0 0 Y Figure 7 next Q Q 0 X Y Q Q 0 J K J K 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Figure 9 28K x 32 -to-2 ecoder ecoder Truth Table input data lines address lines chip select read / not write T RS CS R / W output data lines 0 0 0 0 0 0 X 0 0 28K x 32 RM chip -to-2 decoder with enable Figure 2a 2-to-4 ecoder 2 0 2 0 2 3 0 2 2 0 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 X X 0 0 0 0 2-to-4 decoder with enable Figure 2b Simplified truth table for 4-to-6 decoder with enable. 3 2 0 LIN OUT (hot; i.e., set to ) 0 0 0 0 0 0 0 0 0 0 0 2 0 0 3 0 0 0 4 0 0 5 0 0 6 0 7 0 0 0 8 0 0 9 0 0 0 0 0 0 2 0 3 0 4 5 X X X X (none)
C20B, Spring 2003. Final xam lab questions.. (7 pts. total) For the ideal operational amplifier in Figure answer the following questions: +V power V - - V out V + + -V power Figure. a) (4 points) How would you connect two resistors R and R 2 to the op-amp such that it will function as an inverting amplifier? (raw the diagram). b) (3 points) How will you choose the above resistors to create a voltage inverter (output voltage is equal and opposite to the input voltage)? c) (4 points) How would you connect two resistors R and R 2 to the op-amp such that it will output +V power when input voltage V in is greater than threshold voltage V t, and -V power when it is smaller? (raw the diagram). d) (3 points) Write down an expression for the threshold voltage V t of the above comparator as a function of R, R 2 and V power. e) (3 points) Write down an expression for V + and V - that represents the virtual short assumption. Final xam lab questions C20B /4
2. (7 pts. total) For a circuit similar to the robot restart circuit (Figure 2) complete the timing diagram. Clearly mark the minimum and maximum voltages at each panel. t the bottom panel show the output when the reset button is closed. R2 R B C C2 C Reset R3 B C (Reset closed) Figure 2. Final xam lab questions C20B 2/4
3. (8 pts. total) For the enter key detector circuit studied in lab (Figure 3) answer the following questions: R7 =.8 kω Clock Input C H NTR R0 = 5 k Ω R9 = 00 k Ω C Q B _ C Q F G C7 = 6800 pf Teach Pendant R5 = 5 k Ω Figure 3. a) (6 points) Write down a Boolean expression for the output H as a function of the inputs B,, F and the clock input C. b) (2 points) Complete the timing diagram in the Figure 4 below when the teach pendant is attached. Both flip-flops are positive edge triggered. (Hint, don t forget about C7 and R7 when drawing the output H) C B F G H Figure 4. Final xam lab questions C20B 3/4
4. (4 pts. total) Memory system & programming of the robot: a) (2 points) Suppose instructions in our robot are stored on a chip with 4 input memory lines and 9 address lines from the counter. What is the total size of the program (number of instructions) that can be stored on the chip? (a) 28 (b) 256 (c) 52 (d) 024 (e) 2048 b) (2 points) What is the total size (number of bits stored) of the memory for the above chip? (a) 28 (b) 256 (c) 52 (d) 024 (e) 2048 c) (2 point) How many combinations of input instructions are possible at a single memory address for the above chip? (a) 4 (b) 8 (c) 6 (d) 32 (e) 64 d) (2 points) stimate what clock rate you will use to let the single complete program for the above robot with 4 input memory lines and 9 address lines (all connected to counter) run for 256s? (a) 0.25Hz (b) 0.5Hz (c) Hz (d) 2Hz (e) 4Hz e) (2 points) How will the length of a single step by the robot (forward movement) be changed if you double the clock frequency? (a) will increase 2 times (b) will stay the same (c) will decrease 2 times f) (2 points) How will the angle of a single step by the robot (left/right turn) be changed if you halve the clock frequency? (a) will increase 2 times (b) will stay the same (c) will decrease 2 times g) (2 points) escribe how would you program the robot to repeat all the instructions already stored in memory? How would you program the pause command? Final xam lab questions C20B 4/4