ENGG1015: Homework 1

Similar documents
ENGG1015 Homework 1 Question 1. ENGG1015: Homework 1

Homework 1. Part(a) Due: 15 Mar, 2018, 11:55pm

SOLUTION. Homework 1. Part(a) Due: 15 Mar, 2018, 11:55pm

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

ENGG1015 Homework 3 Question 1. ENGG1015: Homework 3

Foundations of Computation

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

EGC221: Digital Logic Lab

Sequential Logic (3.1 and is a long difficult section you really should read!)

Finite State Machine (FSM)

Digital Electronics. Part A

State and Finite State Machines

University of Florida EEL 3701 Fall 2014 Dr. Eric. M. Schwartz Department of Electrical & Computer Engineering Wednesday, 15 October 2014

Numbers and Arithmetic

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

Laboratory Exercise #11 A Simple Digital Combination Lock

Synchronous Sequential Circuit Design. Digital Computer Design

University of Florida EEL 3701 Summer 2015 Dr. Eric. M. Schwartz Department of Electrical & Computer Engineering Tuesday, 30 June 2015

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

ENGG 1203 Tutorial_9 - Review. Boolean Algebra. Simplifying Logic Circuits. Combinational Logic. 1. Combinational & Sequential Logic

Ch 9. Sequential Logic Technologies. IX - Sequential Logic Technology Contemporary Logic Design 1

Systems I: Computer Organization and Architecture

Different encodings generate different circuits

Digital Signal 2 N Most Significant Bit (MSB) Least. Bit (LSB)

Philadelphia University Student Name: Student Number:

Lecture 5: Using electronics to make measurements

Design of Sequential Circuits

Lab #10: Design of Finite State Machines

Lab 3 Revisited. Zener diodes IAP 2008 Lecture 4 1

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note Introduction: Op-amps in Negative Feedback

Combinational Logic. By : Ali Mustafa

ENGG 1203 Tutorial_05. Use of Multimeter. Lab 5 : SYSTEM. Office hours : Chow Yei Ching, CB-LG205 Thu, Fri; 15:30-17:30

PAST EXAM PAPER & MEMO N3 ABOUT THE QUESTION PAPERS:

Combinational Logic Trainer Lab Manual

CE1911 LECTURE FSM DESIGN PRACTICE DAY 1

Voltage, Current, Resistance and Power Report Tips

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

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

CS61C : Machine Structures

Digital Electronic Meters

Laboratory Exercise #10 An Introduction to High-Speed Addition

( ) ( ) = q o. T 12 = τ ln 2. RC Circuits. 1 e t τ. q t

Lecture 5: Using electronics to make measurements

CS61C : Machine Structures

Binary addition (1-bit) P Q Y = P + Q Comments Carry = Carry = Carry = Carry = 1 P Q

Solution (a) We can draw Karnaugh maps for NS1, NS0 and OUT:

Experiment 7: Magnitude comparators

University of Toronto Faculty of Applied Science and Engineering Department of Electrical and Computer Engineering Midterm Examination

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

Review Problem 1. should be on. door state, false if light should be on when a door is open. v Describe when the dome/interior light of the car

Numbers & Arithmetic. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. See: P&H Chapter , 3.2, C.5 C.

ECE 341. Lecture # 3

Overview. Multiplexor. cs281: Introduction to Computer Systems Lab02 Basic Combinational Circuits: The Mux and the Adder

64K x 18 Synchronous Burst RAM Pipelined Output

RC Circuit Lab - Discovery PSI Physics Capacitors and Resistors

ECE 220 Laboratory 4 Volt Meter, Comparators, and Timer

FSM Examples. Young Won Lim 11/6/15

CprE 281: Digital Logic

State & Finite State Machines

Lecture 13: Sequential Circuits, FSM

EECE 202 (Network I) & EECE 208 (Lab)

Lab 10: DC RC circuits

Module 1, Add on math lesson Simultaneous Equations. Teacher. 45 minutes

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

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Digital Logic

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) State any two Boolean laws. (Any 2 laws 1 mark each)

Lecture 17: Designing Sequential Systems Using Flip Flops

Laboratory Exercise #8 Introduction to Sequential Logic

Digital Logic Design ENEE x. Lecture 14

State & Finite State Machines

UNIT 4 MINTERM AND MAXTERM EXPANSIONS

DM74LS90 DM74LS93 Decade and Binary Counters

Schedule. ECEN 301 Discussion #25 Final Review 1. Date Day Class No. 1 Dec Mon 25 Final Review. Title Chapters HW Due date. Lab Due date.

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

DM74LS90/DM74LS93 Decade and Binary Counters

LAB 2 - ONE DIMENSIONAL MOTION

Lecture 7: Logic design. Combinational logic circuits

Motion II. Goals and Introduction

Digital Circuits ECS 371

Designing Information Devices and Systems I Spring 2017 Babak Ayazifar, Vladimir Stojanovic Homework 6

Simultaneous equations for circuit analysis

Bfh Ti Control F Ws 2008/2009 Lab Matlab-1

1 Boolean Algebra Simplification

CPE100: Digital Logic Design I

Dept. of ECE, CIT, Gubbi Page 1

Lecture 8: Sequential Networks and Finite State Machines

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

Complete all the identification fields below or 10% of the lab value will be deduced from your final mark for this lab.

MM54HC73 MM74HC73 Dual J-K Flip-Flops with Clear

DM5490 DM7490A DM7493A Decade and Binary Counters

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

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec09 Counters Outline.

Designing Information Devices and Systems I Fall 2015 Anant Sahai, Ali Niknejad Homework 8. This homework is due October 26, 2015, at Noon.

Designing Information Devices and Systems I Spring 2018 Homework 7

Generalized FSM model: Moore and Mealy

Lecture 13: Sequential Circuits, FSM

CMSC 313 Lecture 17. Focus Groups. Announcement: in-class lab Thu 10/30 Homework 3 Questions Circuits for Addition Midterm Exam returned

Numbers and Arithmetic

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec 09 Counters Outline.

Transcription:

ENGG1015 Homework 1 Question 1 ENGG1015: Homework 1 Due: Nov 5, 2012, 11:55pm Instruction: Submit your answers electronically through Moodle (Link to Homework 1). You may type your answers using any text editor of your choice, or you may submit a scanned copy of your hand written answer. Acceptable file format: Text file (.txt) OpenDocument file (.odt) MS Word file (.doc /.docx) Portable Document File (.pdf) You need to design your circuit in Logisim for question 2. Logisim can be downloaded freely from http://ozark.hendrix.edu/~burch/logisim/. It runs on Linux, Mac, and Windows machines. Question 1 Four-bit subtractor You and your lab partner has just completed Lab 2 on the design of a four-bit adder. Feeling very adventurous, your group partner suggests to embark on a design of a four-bit subtractor using combinational logic. The circuit is intended to calculate x y = d, where x is represented by four bits as x 3 x 2 x 1 x 0, y is represented by four bits as y 3 y 2 y 1 y 0, and the difference, d, is also represented by four bits as d 3 d 2 d 1 d 0. Your group partner reasons that she should build a one-bit subtractor first, and use it as a building block to complete the entire four-bit subtraction. She also quickly realizes that even for a one-bit subtraction, she needs to borrow from the next bit if x 0 < y 0. She calls this signal borrow, and label it b 0. She requires that b 0 = 1 if and only if there is a need to borrow from the next bit. Complete the following truth table for a 1-bit subtractor with a borrow bit. x 0 y 0 b 0 d 0 0 0 0 1 1 0 1 1 Based on the above truth table, your partner has constructed the following one-bit subtractor circuit, which she then labels as a sub-circuit with the name HS. Label on the circuit input/output x 0, y 0, d 0, and b 0. HS EEE/ENGG1015/2012 Page 1 of 7

ENGG1015 Homework 1 Question 2 Part(c) Next, she proceeds to design a one-bit subtractor for the remaining bits. She argues that now she needs three inputs: for example, to calculate x 1 y 1, she also needs to know b 0, i.e. whether there has been a borrow in the previous calculation of the bit to the right. Complete the following truth table: Part(d) b 0 x 1 y 1 b 1 d 1 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Write b 1 and d 1 as a sum-of-product of the three inputs. Part(e) Use Karnaugh map to simplify the expressions for b 1 and d 1. Show your steps in the answer. Part(f) The HS sub-circuit, with the same positioning of the inputs and outputs, is now used to build the one-bit subtractor with x 1, y 1, and b 0. The student designs it as follows: x 1 HS HS r y 1 s b 0 Show that r and s give you d 1 and b 1. Which is which? Part(g) You are now ready to test the four-bit subtractor. subtractor. What is the output d? Try to perform 1101 0110 using your Part(h) You then proceed to calculate 0110 1101. What is the output d? Explain why. Question 2 Traffic Light As an elite engg1015 student, the traffic department has just hired you to redesign the traffic light control in their new smart traffic light system. As shown in Figure 1, the basic operation of the traffic light is a very simple sequence: The light starts with lighting red for 60 seconds, turn to both red+yellow color for 5 seconds, then green for 60 seconds, then yellow for 5 seconds, and finally return to red and the cycle repeats. EEE/ENGG1015/2012 Page 2 of 7

ENGG1015 Homework 1 Question 2 60 seconds 5 seconds 60 seconds 5 seconds Figure 1: Traffic light sequence State Transition Diagram You have decided to use four (4) states to represent the state during which the traffic light displays red, red+yellow, green, and yellow respectively. Furthermore, to keep track of the time a light is on, a simple binary counter is used. When the signal startcnt is asserted (set to 1 ), the counter starts counting from 0 after the clock edge. The counter send two signals back to the state machine. The signal cnt5 is asserted when the counter s value is 5. The signal cnt60 is asserted when counter s value is 60. The counter is clocked at 1Hz. The following table summarizes the I/O signals for your traffic light control: Type Name Description input cnt5 1 when the counter s value is 5, indicating 5 seconds have passed. 0 otherwise. cnt60 1 when the counter s value is 60, indicating 60 seconds have passed. 0 otherwise. output startcnt Output to the binary counter to start counting from zero. R 1 to turns on red light, 0 otherwise Y 1 to turns on yellow light, 0 otherwise G 1 to turns on green light, 0 otherwise Complete the following state transition diagram for the traffic light control. cnt60 = 0 cnt60 = 1 RED RED-YELLOW YELLOW GREEN Next State & Output Logic You have decided to utilize the following state encoding for the four states: EEE/ENGG1015/2012 Page 3 of 7

ENGG1015 Homework 1 Question 2 State s1 s0 RED 0 0 RED-YELLOW 0 1 YELLOW 1 0 GREEN 1 1 Based on your state transition diagram and the above state encoding, complete the following truth table concerning the next state and output logic of the traffic light control state machine. s1 s0 cnt5 cnt60 ns1 ns0 startcnt R Y G 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 1 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 1 1 1 0 0 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 Part(c) Logisim Implementation Implement the above traffic light control state machine in Logisim. Apart from the I/O described above, your machine should also include a clock input clk, and a reset input clr. The following table summarizes the input/output ports of your state machine. The column Order indicates the order of the pin in the circuit symbol. Direction Order Name Logisim Type input 1 cnt5 Pin 2 cnt60 Pin 3 clk Pin 4 clr Pin output 1 startcnt Pin 2 R Pin 3 Y Pin 4 G Pin Your circuit will be graded automatically, so it is very important for you to use the exact pin names in the above table in your circuit. Download the file http://www.eee.hku.hk/ ~engg1015/fa12/handouts/hw1src.zip. You may use the included tlight.circ as a template for your design. You may find the file tlight-test.circ useful for testing your circuit. Put the two files (tlight.circ and tlight-test.circ) in the same directory for the file tlight-test.circ to run. Save your answer in tlight.circ and submit this file via Moodle. Part(d) A Smarter Traffic Light System The traffic department wants to improve the basic traffic light from the previous part to relieve Hong Kong s traffic problem. A new sensor is installed in the road to determine the number of cars waiting in front of the traffic light. The sensor produces a signal carwait to your traffic light state machine. carwait is 1 when more than 10 cars are waiting in front of the traffic light, 0 otherwise. EEE/ENGG1015/2012 Page 4 of 7

ENGG1015 Homework 1 Question 3 Using the new signal, a new light controlling algorithm is added on top of the basic control. With the new algorithm: If more than 10 cars are waiting while the light is RED, it should turn to GREEN (via RED-YELLOW) immediately. If more than 10 cars are waiting while the light is GREEN, it indicates the road is jammed. Turn the light to RED (via YELLOW) to relieve traffic in cross direction. If carwait is 0, the traffic light operates according to the simple sequence in Part (a). Complete the following state diagram incorporating the improved smart algorithm: cnt60 = 0 cnt60 = 1 RED RED-YELLOW YELLOW GREEN Part(e) Smart Traffic Light Control in Logisim Implement your improved state machine in Logisim. It should be similar to the above previous machine except for the additional carwait input. The carwait signal should have an order of 1 and is the top-left-most pin in the symbol. You may use the file smartlight.circ included in hw1files.zip you downloaded above as a starting point. Similarly, you may use smartlight-test.circ to test your design. Submit your design in smartlight.circ in Moodle. Question 3 Force Sensitive Resistor A force sensitive resistor (FSR) is a resistor with its resistance changed according to the force applied to it. The table below shows the resistance of a sample FSR. For your reference k and M are SI units that represents 10 3 and 10 6 respectively. Force (N) 0 1 M 0.5 10k 1 6k 10 1k Resistance R fsr (Ω) Your project partner has decided to use such FSR in the project. For simplicity sake, he has wired up the FSR using a simple potential divider circuit as shown in Figure 2. EEE/ENGG1015/2012 Page 5 of 7

ENGG1015 Homework 1 Question 3 Vcc = 12V R fsr vout R ref Figure 2: Connecting an FSR with a potential divider configuration. For each value of force shown in the above table, calculate the following quantities when R ref = 10kΩ: 1. Current flowing through the FSR; 2. Voltage across the FSR; 3. Voltage at V out. The output V out is used to detect the presence of a ball. Due to its light weight, the ball produces only 0.5N when it is located on top of the sensor. The rest of the system requires that V IL = 2V and V IH = 10V, where V IL is the maximum voltage that the system regards as logical LOW and V IH is the minimum voltage that the system regards as logical HIGH. Determine the range of value that R ref may take for correct functioning of the circuit It should output a logical HIGH when a ball is presence and a logical LOW otherwise. Part(c) Your group partner suggests that it may be possible to use 2 FSRs connected as shown in the following figure to perform a logical OR operation: When the ball rolls over either one of the 2 FSRs, the output V out is HIGH, and is LOW otherwise. Vcc = 12V R fsr R fsr vout R ref What is the output voltage V out in the following three cases: (i) 1 of the FSRs is under pressure of 0.5N, (ii) both FSRs are under a pressure of 0.5N each, (iii) none of the FSRs is under pressure. Assume R ref is 100kΩ. Part(d) Recall that V IL is 2V and V IH is 10V, is the circuit functioning correctly as a 2-input OR function? If there are 3 FSRs connected in parallel, assumer R ref remains at 100kΩ, will the circuit behave as a 3-input OR function? Explain your answer. EEE/ENGG1015/2012 Page 6 of 7

ENGG1015 Homework 1 Question 4 Question 4 Feedback Questions Answering this question is optional, but your answer will help us evaluate the course more effectively. Mathematics for Signals, Systems & Control 1. Evaluate 1 + i, where i = 1. 2. Find the roots of z 2 + 5z + 1. 3. Find the roots of z 2 + 2z + 3. 4. We have Find A and B. 1 z 2 + 3z + 2 = 5. We have 3 + i = Ae iθ. Find A and θ. A z + 2 + B z + 1. Lectures & Labs 1. How much time have you spent on this homework? 2. Do you think 2 hours of lab is enough? If not, is a 3-hour session a better option? 3. Have you checked off labs during TA office hours? If so, were the TAs helpful during office hour? 4. Any other comments on lecture? EEE/ENGG1015/2012 Page 7 of 7