This preview shows pages 1–3. Sign up to view the full content.
Homework 4 ECE 252 Spring 2008
Primary contact for this homework: Spyros Blanas [sblanas at cs dot wisc
dot edu]
You must do this homework alone. Please staple multiple pages together.
Make sure to include your name and your section.
Problem 1
One of the fundamental units of all processors is the unit which can handle
simple arithmetic. For this problem, assume that you have a 1digit full
adder, a multiplexer, a decoder and all basic gates, all of which work as
described in the class.
a. Design an arithmetic unit which takes two 4bit numbers in 2's
complement representation, named A and B and a 1bit "operation"
flag O and produces the 4bit result. If the O=0 then the output is
A+B. If O=1 then the output becomes AB.
b. Extend your design by adding an overflow signal OVF which is 1 if and
only if an arithmetic overflow occurs.
Problem 2
Assume that at a pedestrian crossing the traffic light works in the following
way:
•
Green to vehicles, red to pedestrians for 20 seconds.
•
Amber to vehicles, red to pedestrians for 5 seconds.
•
Red to vehicles, green to pedestrians for 10 seconds.
•
Red to vehicles and pedestrians for 5 seconds.
The traffic light is controlled by a 5bit value, which can be interpreted as
follows:
Bit
Description
4 (MSB) Vehicle red light is on.
3
Vehicle amber light is on.
2
Vehicle green light is on.
1
Pedestrian red light is on.
0 (LSB)
Pedestrian green light is on.
(For example, using this representation, the value which turns all the red
lights on is 10010.)
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Documenta. Create the finite state machine which will control this traffic light if
each clock cycle is 5 seconds. Show the output at each state.
b. Add a pedestrian button which changes the traffic light to amber in the
This is the end of the preview. Sign up
to
access the rest of the document.
 Spring '08
 Wood

Click to edit the document details