University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science SOLUTIONS

Similar documents
EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

Chapter 5 Sequential Circuits

1. Convert the decimal number to binary, octal, and hexadecimal.

Asynchronous (Ripple) Counters

Sequential logic. Circuits with feedback. How to control feedback? Sequential circuits. Timing methodologies. Basic registers

55:131 Introduction to VLSI Design Project #1 -- Fall 2009 Counter built from NAND gates, timing Due Date: Friday October 9, 2009.

Flip-flop and Registers

Switching Circuits & Logic Design, Fall Final Examination (1/13/2012, 3:30pm~5:20pm)

Module 4:FLIP-FLOP. Quote of the day. Never think you are nothing, never think you are everything, but think you are something and achieve anything.

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

Name Of The Experiment: Sequential circuit design Latch, Flip-flop and Registers

Lecture 8: Sequential Logic

CPS311 Lecture: Sequential Circuits

problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

EECS150 - Digital Design Lecture 15 Finite State Machines. Announcements

CSE Latches and Flip-flops Dr. Izadi. NOR gate property: A B Z Cross coupled NOR gates: S M S R Q M

EL302 DIGITAL INTEGRATED CIRCUITS LAB #3 CMOS EDGE TRIGGERED D FLIP-FLOP. Due İLKER KALYONCU, 10043

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

Sequential Design Basics

1. a) For the circuit shown in figure 1.1, draw a truth table showing the output Q for all combinations of inputs A, B and C. [4] Figure 1.

Where Are We Now? e.g., ADD $S0 $S1 $S2?? Computed by digital circuit. CSCI 402: Computer Architectures. Some basics of Logic Design (Appendix B)

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District UNIT-III SEQUENTIAL CIRCUITS

VeriLab. An introductory lab for using Verilog in digital design (first draft) VeriLab

cascading flip-flops for proper operation clock skew Hardware description languages and sequential logic

Introduction. NAND Gate Latch. Digital Logic Design 1 FLIP-FLOP. Digital Logic Design 1

Introduction. Serial In - Serial Out Shift Registers (SISO)

Counter dan Register

ECE 263 Digital Systems, Fall 2015

(CSC-3501) Lecture 7 (07 Feb 2008) Seung-Jong Park (Jay) CSC S.J. Park. Announcement

EECS 270 Final Exam Spring 2012

ELCT201: DIGITAL LOGIC DESIGN

SEQUENTIAL LOGIC. Satish Chandra Assistant Professor Department of Physics P P N College, Kanpur

Logic Design. Flip Flops, Registers and Counters

EE292: Fundamentals of ECE

Multiplexor (aka MUX) An example, yet VERY useful circuit!

COMP sequential logic 1 Jan. 25, 2016

Logic Design ( Part 3) Sequential Logic- Finite State Machines (Chapter 3)

Final Exam review: chapter 4 and 5. Supplement 3 and 4

MODU LE DAY. Class-A, B, AB and C amplifiers - basic concepts, power, efficiency Basic concepts of Feedback and Oscillation. Day 1

Combinational vs Sequential

The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

IT T35 Digital system desigm y - ii /s - iii

Experiment 8 Introduction to Latches and Flip-Flops and registers

D Latch (Transparent Latch)

RS flip-flop using NOR gate

Department of Electrical and Computer Engineering Mid-Term Examination Winter 2012

Solution to Digital Logic )What is the magnitude comparator? Design a logic circuit for 4 bit magnitude comparator and explain it,

CS 110 Computer Architecture. Finite State Machines, Functional Units. Instructor: Sören Schwertfeger.

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Sequential Circuits

Counters

COE 202: Digital Logic Design Sequential Circuits Part 1. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

MC9211 Computer Organization

COMP2611: Computer Organization. Introduction to Digital Logic

Digital Fundamentals: A Systems Approach


RS flip-flop using NOR gate

CprE 281: Digital Logic

UNIVERSITI TEKNOLOGI MALAYSIA

Chapter 6. sequential logic design. This is the beginning of the second part of this course, sequential logic.

Chapter 6. sequential logic design. This is the beginning of the second part of this course, sequential logic.

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science. EECS 150 Spring 2000

Sequential Circuits. Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs)

Rangkaian Sekuensial. Flip-flop

Synchronous Sequential Logic

CSE115: Digital Design Lecture 23: Latches & Flip-Flops

Principles of Computer Architecture. Appendix A: Digital Logic

MODULE 3. Combinational & Sequential logic

COE328 Course Outline. Fall 2007

CHAPTER 4: Logic Circuits

Previous Lecture Sequential Circuits. Slide Summary of contents covered in this lecture. (Refer Slide Time: 01:55)

VTU NOTES QUESTION PAPERS NEWS RESULTS FORUMS Registers

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Sequential Circuits

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING DIGITAL DESIGN

CHAPTER 4: Logic Circuits

Chapter 5. Introduction

More Digital Circuits

ELE2120 Digital Circuits and Systems. Tutorial Note 7

Register Transfer Level in Verilog: Part II

Modeling Digital Systems with Verilog

Report on 4-bit Counter design Report- 1, 2. Report on D- Flipflop. Course project for ECE533

Digital Logic. ECE 206, Fall 2001: Lab 1. Learning Objectives. The Logic Simulator

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 151) Pass Marks: 24

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

ELE2120 Digital Circuits and Systems. Tutorial Note 8

ELCT201: DIGITAL LOGIC DESIGN

EECS 270 Group Homework 4 Due Friday. June half credit if turned in by June

EMT 125 Digital Electronic Principles I CHAPTER 6 : FLIP-FLOP

More design examples, state assignment and reduction. Page 1

Computer Architecture and Organization

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

Digital Circuits ECS 371

Quiz #4 Thursday, April 25, 2002, 5:30-6:45 PM

Module -5 Sequential Logic Design

Universal Asynchronous Receiver- Transmitter (UART)

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

Design and Simulation of a Digital CMOS Synchronous 4-bit Up-Counter with Set and Reset

Vignana Bharathi Institute of Technology UNIT 4 DLD

CSE 140 Exam #3 Tajana Simunic Rosing

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science. EECS150, Spring 2011

Transcription:

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science EECS 5 Fall 25 R. H. Katz SOLUTIONS Problem Set #3: Combinational and Sequential Logic Assigned 4 September 25, Due 23 September at 2 PM. Design a combinational logic subsystem with three inputs, I 3, I 2, I, and two outputs, O, O, that behaves as follows. The outputs indicate the highest index of the inputs that is driven high. For example, if I 3 is, I 2 is, I is, then O, O would be (i.e., I 2 is the highest input set to ). If none of the inputs is, then the outputs would be. a. Specify the subsystem by filling out a complete truth table for the two outputs. I3 O O b. Write a specification of this function in Verilog. (note, this is using simplified product-of-sums as listed in part c) module f(o, o, i3, i2, i); input i3, i2, i; output o, i; assign o =!i2 & i i3; assign o = i3 i2;

c. Find the minimized Sum of Products description using K-maps. K-map of O I3 O = I2 I + I3 K-map of O I3 O = I3 + I2 d. Implement the subsystem using 2 x 4: multiplexers. I O O I3I2 I3I2 e. If implemented using a ROM, what size ROM is required? Why? The ROM would require 6 bits total. Each O and O is a function of I3 I2 and I, which have a total of 8 combinations each. f. Compare your solutions in parts (c) and (d). Which is simpler and why (i.e., what criteria are you using to measure complexity)? The multiplexor circuit is simpler because its implementation would use less transistors than a look-up table.

2. Scientists have discovered that the Venusians use a base 6 number system. However, the digits are quite different than the ones to which we are accustomed. The first row below is through 7, and the second row is 8 through F. Your task is to design a combinational logic subsystem to decode a hexadecimal digit in the range of () through F () to drive a seven-segment display for the Martian version of the hexadecimal digits (-7 in the top row, 8-F in the bottom row). The LED segments are numbered counter clockwise starting at the horizontal LED at the bottom (LED ). The middle LED is LED 6. 4 5 3 6 2 a. Specify the function by filling out a complete truth table for each of the seven segment drivers. O O O2 O3 O4 O5 O6

Write each as a Verilog specification. module o(o, i, i, i2, i3, i4); input i4, i3, i2, i; output o; assign o = (!I3 & I2 & I & I) (I3 &!I2 &!I &!I) (I3 &!I2 &!I & I) (I3 &!I2 & I &!I) (I3 &!I2 & I & I) (I3 & I2 &!I &!I) (I3 & I2 &!I & I) (I3 & I2 & I &!I) (I3 & I2 & I & I); module o(o, i, i, i2, i3, i4); input i4, i3, i2, i; output o; assign o = (!I3 & I2 &!I & I) (!I3 & I2 & I &!I) (!I3 & I2 & I & I) (I3 & I2 &!I &!I) (I3 & I2 &!I & I) (I3 & I2 & I &!I) (I3 & I2 & I & I);

module o2(o2, i, i, i2, i3, i4); input i4, i3, i2, i; output o2; assign o2 = (!I3 & I2 &!I &!I) (!I3 & I2 &!I & I) (!I3 & I2 & I &!I) (!I3 & I2 & I & I) (I3 &!I2 &!I &!I) (I3 &!I2 &!I & I) (I3 & I2 &!I & I) (I3 & I2 & I &!I); module o3(o3, i, i, i2, i3, i4); input i4, i3, i2, i; output o3; assign o3 = (!I3 &!I2 & I & I) (!I3 & I2 &!I &!I) (!I3 & I2 &!I & I) (!I3 & I2 & I &!I) (!I3 & I2 & I & I) (I3 &!I2 &!I &!I) (I3 &!I2 &!I & I) (I3 &!I2 & I &!I);

module o4(o4, i, i, i2, i3, i4); input i4, i3, i2, i; output o4; assign o4 = (!I3 &!I2 & I &!I) (!I3 &!I2 & I & I) (!I3 & I2 &!I &!I) (!I3 & I2 &!I & I) (!I3 & I2 & I &!I) (!I3 & I2 & I & I) (I3 &!I2 &!I &!I) (I3 &!I2 &!I & I) (I3 &!I2 & I &!I) (I3 &!I2 & I & I); module o5(o5, i, i, i2, i3, i4); input i4, i3, i2, i; output o5; assign o5 = (!I3 &!I2 &!I & I) (!I3 &!I2 & I &!I) (!I3 &!I2 & I & I) (!I3 & I2 &!I &!I) (!I3 & I2 &!I & I) (!I3 & I2 & I &!I) (!I3 & I2 & I & I) (I3 &!I2 &!I &!I) (I3 &!I2 &!I & I) (I3 &!I2 & I &!I) (I3 &!I2 & I & I) (I3 & I2 &!I &!I) (I3 & I2 & I & I);

module o6(o6, i, i, i2, i3, i4); input i4, i3, i2, i; output o6; assign o6 = (!I3 & I2 & I &!I) (!I3 & I2 & I & I) (I3 &!I2 &!I &!I) (I3 & I2 & I &!I) (I3 & I2 & I & I); c. Develop the minimized gate-level implementation using the K-map method, minimizing each K-map independently. O O = I4 + I3 O O = + I3 I + I3 I2 O2 O2 = I4 I3 + I4 + I2 + I3 O3

O3 = I3 I2 + I4 I3 + I4 + I3 O4 O4 = + I4 I3 + I2 I4 O5 O5 = + I4 I3 + + I2 I I3 + I4 I O6 O6 = I2 I + I2 I3

d. Repeat (c), but this time, minimize so as to exploit shared product terms wherever possible, as though the implementation target is a PLA. (There may be several solutions) O O = + + I3 O O = + I3 I2 I + I3 + I3 O2 O2 = I4 I3 + I4 + I2 + I3 O3 O3 = I3 I2 I + I3 I2 I + I4 + I3

O4 O4 = + I4 I3 + I2 I4 O5 O5 = + I4 I3 + + I2 I I3 + I4 I O6 O6 = I2 I + I2 I3 e. How does the complexity of your answers to (c) and (d) compare? Which is simpler and why? What criteria are you using to measure the complexity of these two different implementations? Although D may not be the most simplified sum of products expression, it will be easier to implement than C because many of the terms may be shared between the outputs. 3. Your textbook presents the concept of a Master-Slave flip-flop, constructed from two cascaded stages of R-S flip-flops (see Figure 6.8 on page 269). a. Master-Slave flip-flops implemented in this way exhibit the phenomena of ones catching. Explain what it is and why it happens. Is it possible for a Master-Slave flip-flop to catch zeros? Justify your answer! One s catching means the output of the Master-Slave flip-flop will be a, until a is sensed at the input. Once this happens, the output will become at the next clock cycle and remain at for the remaining clock cycles or until a reset signal is received. zero-catcher can be constructed

by inverting the input of the one-catcher b. Suppose that you implement a Master-Slave flip-flop as two cascaded D flip-flops, the first stage a positive edge triggered D FF and the second stage a negative edge triggered D FF. Draw a timing chart with a clock waveform and a D input that oscillates from to or to each time the clock is low. Make sure you show how the two flip-flops outputs change in response to input and clock changes. D Q' D2 Q2' Q Q2 D Q Q2 4. Your textbook presents a negative edge-triggered D flip-flop using NOR gates (see Figure 6.24 on page 272). a. Implement a positive-edge triggered D flip-flop function using NAND gates only. A D Q Q' A'

b. Explain the timing behavior of this circuit. Label your internal circuit nodes, show their waveforms on the timing chart, and use these waveforms to briefly explain why the triggering works. D A Q A changes on the rising edge of, and Q changes on the falling edge of. 5. Design a 3-bit counter that implements the following sequence:,,,,,,,, and repeat. Design the counter with a reset input that causes the counter to enter the state. a. Write a Verilog specification for this counter. module weirdcounter(clk, rst, out); parameter s = 3 b; parameter s = 3 b; parameter s2 = 3 b; parameter s3 = 3 b; parameter s4 = 3 b; parameter s5 = 3 b; parameter s6 = 3 b; parameter s7 = 3 b; input clk, rst; output [2:] out; reg out; reg [2:] ps, ns; assign out = ps; always@(posedge clk) begin if(rst) ps <= s; else ps <= ns; end always@(ps) case(ps) s: ns = s;

end s: ns = s2; s2: ns = s3; s3: ns = s4; s4:ns = s5; s5: ns=s6; s6:: ns=s; default: ns = s; b. Design the next state functions and minimize for PLA-based implementation. PS PS NS2 NS NS (The PLA optimized form is the same as the minimized Sum-of Products form) NS PS PS NS = PS PS + PS + PS NS PS PS NS = PS PS + PS + PS NS2 PS PS NS2 = PS PS + PS + PS

c. Show how to implement this counter using 2: multiplexers and D flipflops only. You may assume that the D FFs have a reset input. NS2 D Q CONTROL HARDWARE (See details below) RESET Q' ' NS D Q PS RESET Q' PS' NS D Q PS RESET Q' PS' CONTROL HARDWARE NS NS PS PS' PS PS' PS PS' PS PS' NS2 PS PS' PS PS' d.