COE 328 Final Exam 2008

Similar documents
UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

Dr. Nicola Nicolici COE/EE2DI4 Midterm Test #2 Nov 22, 2006

ECE 448 Lecture 6. Finite State Machines. State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code. George Mason University

Table of Content. Chapter 11 Dedicated Microprocessors Page 1 of 25

Finite State Machine (FSM)

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

Assignment # 3 - CSI 2111(Solutions)

7 Multipliers and their VHDL representation

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Vidyalankar. S.E. Sem. III [EXTC] Digital System Design. Q.1 Solve following : [20] Q.1(a) Explain the following decimals in gray code form

FSM model for sequential circuits

Lecture 13: Sequential Circuits, FSM

Lecture 13: Sequential Circuits, FSM

Preparation of Examination Questions and Exercises: Solutions

Synchronous Sequential Circuit Design. Digital Computer Design

Vidyalankar S.E. Sem. III [EXTC] Digital Electronics Prelim Question Paper Solution ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD = B

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

Written reexam with solutions for IE1204/5 Digital Design Monday 14/

Luleå Tekniska Universitet Kurskod SMD098 Tentamensdatum

ECE 3401 Lecture 23. Pipeline Design. State Table for 2-Cycle Instructions. Control Unit. ISA: Instruction Specifications (for reference)

Digital Control of Electric Drives

Counters. We ll look at different kinds of counters and discuss how to build them

ENGG 1203 Tutorial _03 Laboratory 3 Build a ball counter. Lab 3. Lab 3 Gate Timing. Lab 3 Steps in designing a State Machine. Timing diagram of a DFF

Shift Register Counters

Mealy & Moore Machines

Topic 8: Sequential Circuits

Lecture 14: State Tables, Diagrams, Latches, and Flip Flop

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

CprE 281: Digital Logic

Vidyalankar S.E. Sem. III [CMPN] Digital Logic Design and Analysis Prelim Question Paper Solution

Lab #10: Design of Finite State Machines

UNIVERSITY OF WISCONSIN MADISON

Figure 4.9 MARIE s Datapath

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

Example: vending machine

The Design Procedure. Output Equation Determination - Derive output equations from the state table

Chapter 4. Sequential Logic Circuits

Fundamentals of Digital Design

State Machines ELCTEC-131

EXPERIMENT Traffic Light Controller

Models for representing sequential circuits

CSE 140 Midterm 2 Tajana Simunic Rosing. Spring 2008

Sequential Synchronous Circuit Analysis

Final Exam. ECE 25, Spring 2008 Thursday, June 12, Problem Points Score Total 90

Finite State Machine. By : Ali Mustafa

Sequential Logic Circuits

Chapter 3 Digital Logic Structures

Different encodings generate different circuits

Digital Design. Sequential Logic

Unit 16 Problem Solutions

Vidyalankar S.E. Sem. III [ETRX] Digital Circuits and Design Prelim Question Paper Solution

CHW 261: Logic Design

CS61C : Machine Structures

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Chapter 9. Counters and Shift Registers. Counters and Shift Registers

Chapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>

Combinational vs. Sequential. Summary of Combinational Logic. Combinational device/circuit: any circuit built using the basic gates Expressed as

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

or 0101 Machine

CS61C : Machine Structures

Homework #4. CSE 140 Summer Session Instructor: Mohsen Imani. Only a subset of questions will be graded

Synchronous Sequential Circuit Design. Dr. Ehab A. H. AL-Hialy Page 1

EE 209 Spiral 1 Exam Solutions Name:

Ch 7. Finite State Machines. VII - Finite State Machines Contemporary Logic Design 1

Sequential logic and design

Review for Final Exam

Solutions - Final Exam (Online Section) (Due Date: December 11th by 10:00 am) Clarity is very important! Show your procedure!

ALU, Latches and Flip-Flops

CprE 281: Digital Logic

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

EEE2135 Digital Logic Design

ALU A functional unit

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters)

Roger L. Tokheim. Chapter 8 Counters Glencoe/McGraw-Hill

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Topic 8: Sequential Circuits. Bistable Devices. S-R Latches. Consider the following element. Readings : Patterson & Hennesy, Appendix B.4 - B.

Fundamentals of Computer Systems

CMPT-150-e1: Introduction to Computer Design Final Exam

Problem Set 6 Solutions

CPE100: Digital Logic Design I

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

Lecture 10: Synchronous Sequential Circuits Design

Clocked Synchronous State-machine Analysis

Digital Circuits ECS 371

Written exam with solutions IE1204/5 Digital Design Friday 13/

Design at the Register Transfer Level

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

CSE140: Design of Sequential Logic

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

CSE 140 Midterm 3 version A Tajana Simunic Rosing Spring 2015

(Boolean Algebra, combinational circuits) (Binary Codes and -arithmetics)

Chapter 7. Sequential Circuits Registers, Counters, RAM

L10 State Machine Design Topics

EXPERIMENT Bit Binary Sequential Multiplier

Parity Checker Example. EECS150 - Digital Design Lecture 9 - Finite State Machines 1. Formal Design Process. Formal Design Process

Transcription:

COE 328 Final Exam 2008 1. Design a comparator that compares a 4 bit number A to a 4 bit number B and gives an Output F=1 if A is not equal B. You must use 2 input LUTs only.

2. Given the following logic circuit, clock signal, and input waveforms: a) Derive the state assigned table b) Sketch the waveforms for Q1, Q2, Y1, and Y2 in the space provided. Note: Assume zero delay for all gates and flip flops. Figure 1 X=0 X=1 Q 2 Q 1 Y 2 Y 1 Y 2 Y 1 0 0 1 1 1 1 0 1 1 0 1 1 1 0 1 1 0 1 1 1 1 1 0 1 CLK /CLR X Q1 Q2 Y1 Y2 0 15 30 45 60 75 90 105 120 135 150 165 180 195 Time (ns) Figure 2

3. Given the following logic circuit, derive its state table and state diagram. If the following sequencee 1010110101 is applied to the x input of the circuit with the initial sate 01, determine the resulting output sequence on z output. Q 2 Q 1 0 0 0 1 1 0 1 1 x=0 y 2 y 1 0 0 1 0 1 1 0 1 x=1 y 2 y 1 1 0 0 0 0 1 1 1 x=0 0 1 1 0 z x=1 1 0 0 1 Reset 0/0 S 0 1/1 S 2 1/0 1/0 0/1 w = 11 0/1 S 1 0/0 S 3 1/1 S S 1 S 0 x 1 0 z=y 2 0 0 S 0 S 2 1 0 1 1 S 3 S 3 1 1 1 1 3 S 3 0 0 S 1 S 0 1 0 0 0 S 0 1 1

4. The state diagram for a finite state machine (FSM) with one input w and two outputs z2 and z1 is given below w=0 A/01 B/10 w=0 w=0 w=1 D/00 w=1 w=1 C/00 w=0 w=1 a) Does the above state diagram use a Moore or Mealy-type model to represent the FSM? Explain your answer. The state diagram represents Moore type FSM, since outputs are completely defined by states and do not depend on inputs. b) What is the minimum number of state variables required to represent the states? Explain your answer. Two state variables are required, because 2 2 = 4, where 4 is the number of states. c) Using the state assignment: A=00, B=01, C=11, and D=10, develop the next state and output equations for implementing the FSM.

w=0 w=1 Q 2 Q 1 D 2 D 1 D 2 D 1 z 2 z 1 A 0 0 0 1 1 1 0 1 B 0 1 0 0 1 0 1 0 C 1 1 0 1 0 1 0 0 D 1 0 0 0 0 0 0 0 D 2 D 1 w \ Q 2 Q 1 0 0 0 1 1 1 1 0 w \ Q 2 Q 1 0 0 0 1 1 1 1 0 0 0 0 0 0 0 1 0 1 0 1 1 1 0 0 1 1 0 1 0 z 2 z 1 Q 2 \ Q 1 0 1 Q 2 \ Q 1 0 1 0 0 1 0 1 0 1 0 0 1 0 0

5. Assuming that an 8 x 4 bit EPROM is available, explain how the FSM can be implemented with the state assignment in Part C. Fill in the contents of the EPROM in the table below and clearly explain what the addresses and contents of the EPROM represent. Content Address D 3 D 2 D 1 D 0 w A 2 A 1 0 1 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 1 1 0 1 1 1 1 0 0 1 0 0 1 1 0 1 0 0 0 0 1 1 0 0 0 1 0 1 1 1 A 0 D 0 EEPROM D 0 Q 0 D 2 D 1 D 1 Q 2 Q 1 w A 1 D 2 D 3 z 1 D 1 Q 1 FF z 2 w=0 w=1 Q 2 Q 1 D 2 D 1 D 2 D 1 z 2 z 1 A 0 0 0 1 1 1 0 1 B 0 1 0 0 1 0 1 0 C 1 1 0 1 0 1 0 0 D 1 0 0 0 0 0 0 0

6. Which circuit does the following VHDL code represent? LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY system IS PORT (Clock, Reset : IN STD_logic; z : OUT STD_LOGIC_VECTOR(2 DOWNTO 0)); END system; ARCHITECTURE Behavior OF system IS TYPE State_type IS (A,B,C); SIGNAL y: State_type; BEGIN PROCESS (Reset, Clock) BEGIN IF Reset='0' THEN y<=a; ELSIF(Clock'EVENT AND Clock='1') THEN CASE y IS WHEN A=> THEN y<=b; WHEN B=> THEN y<=c; WHEN C=> THEN y<=a; END CASE; END IF; END PROCESS; PROCESS(y) BEGIN CASE y IS WHEN A=> z <= ''110''; WHEN B=> z <= ''101''; WHEN C=> z <= ''011''; END CASE; END PROCESS; END Behavior; Reset Clk Mod 3 Q 2 A/ 11 B/ 10 Reset Counter Q 1 Q 0 C/ 01

7. This question deals with the processor in LAB7 (See also the Appendix) a) The switches (SW) are set to 0110; carry bit (C) equals to 1, program counter (PC) equals to 1010, accumulator (ACCA) equals to 0110, Random Access Memory location 1010 (RAM (A)) contains 1111 and program memory location 1010 (EPROM3 (A)) contains DA hex. What are the contents of PC, ACCA, C, and RAM (A) after the execution of the current instruction? PC=1010 ACCA=0110 C=1 RAM(A)=1111 SW=0110 EPROM(A)=DA=1101 1010 PC=1010 ACCA=0110 C=1 RAM(A)=1111 b) Write a program (not to exceed 16 instructions) for the processor of LAB7 to search the content of memory locations 3 and 4 for a specific number that is specified by the switches. If the number is found in memory location 3 or 4, display the exact memory location that the number is stored at. Display 0 if the number is not found in memory location 3 or 4. (Use comments with each instruction to explain your program). 0 LDAA 3 ; A=M(3) 1 JEQ 6 ; SW=M(3) 2 LDAA 4 ; A=M(4) 3 JEQ 11 ; SW=M(11) 4 CLRA ; SW Not = M(3) or M(4) 5 JMP 5 ; display 0 6 CLRA ; A=0 7 SEC ; C=1 8 ROLA ; A=1 9 ROLA ; A=3 10 JMP 10 ; display 3 11 CLRA ; A=0 12 INCA ; A=1 13 ROLA ; A=2 14 ROLA ; A=4 15 JMP 15 ; display 4

c) In the Processor Instruction Set list above, it is desired to change the STSW N instruction to the STEQ N instruction. The STEQ N instruction would compare contents of the accumulator to data from the switches. If they equal to each other, the data in the accumulator would be inverted and stored into memory location N. Otherwise, control would be transferred to the next instruction in the program storage. Fill in the table for the STEQ N instruction shown below. EPROMs 1&2 Address Lines EPROM1 EPROM2 EPROM3 PAL ACCA ALU181 Data Path 161 EPROM JP N0 OP Code MCode NCC L1 L0 M S3 S2 S1 S0 /AS WR SM /PECNTA1+A0+ A7 A6 A5 A4 A3 A2 A1 A0 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 0 0 1 0 1 1 0 0 1 0 0 0 0 1 1 0 X 1 0 1 1 0 0 1 STEQ N 0 0 1 0 1 1 0 1 1 0 0 X X X X X X 1 0 1 1 1 0 0 0 0 1 0 0 0 1 1 1 0 1 0 1 1 0 0 1 0 0 0 0 1 1 0 X 1 0 1 1 0 0 1 STEQ N 1 0 1 0 1 1 0 1 1 1 1 1 0 0 0 0 X 0 1 0 1 1 0 0 1 0 1 0 1 0 1 1

Appendix The processor below is the one used in project 7. It uses an ALU whose functions are listed on the following page. The processor instruction set is also given on the following page. Shift Register Operating Modes Mode Hold L1 0 0 L0 Shift Right 0 1 Shift Leftt 1 0 Parallel Load 1 1