UIT2201: CS & the IT Revolution
Tutorial Set 7 (Spring 2008)

(D-Problems discussed on Thursday, 13-Mar-2008)
(Q-Problems due on Tuesday, 18-Mar-2008)
[Hardware: Parts 1 and 2]


Practice Problems: (not graded)
(If you have difficulties with these practice problems, please see your classmates or the instructor for help.)

T7-PP1: [Simple Logic Circuit Design]
Consider Output2 in the truth table given in p.166 (S4.4.2)of [SG3].
(a) Write out a logical formula for Output2.
(b) Simplify the formula (from (a)) as much as you can.
(c) Design a circuit that implements Output2.


Discussion Problems: -- Prepare (individually) for tutorial discussion.

T7-D1: (Sound and Image)
(a) (Practice Prob. 1 of S4.2.2 of [SG2,3].)
Using MP3, how many bits are required to store a 3-minute song in uncompressed format? How many such songs can be stored in a 1Gbyte memory-stick? Answer the previous questions again if the information is first compressed with a ratio of 4:1 how many bits are required?
(b) (Practice Prob. 2 of S4.2.2 of [SG2,3].)
How many bits are needed to store a single uncompressed RGB image from a 2.1 megapixel digital camera? How many bytes of memory is this? How many such images can be stored in a 1Gbyte memory-stick?
(Note: Read S4.2.2 on storing sound and images)

T7-D2: (Multiplexor Circuits) [2- and 4-input MUXes]
(a) [2-input MUX] Read up "design of multiplexor circuits" in Sec 4.5 of [SG2,3].
Explain the working of a 2-input multiplexor circuit and the role of the "selector line".
(b) [4-input MUX] (Prob. 23 of Ch.4 of [SG2,3].)
Design a four-input multiplexor circuit. Use the design of the the two-input MUX as a guide.
For simplicity, you can make use of 3-input OR/AND gates.)

T7-D3: (Decoder Circuits)
Read up the design of decoder circuits in Section 4.5 of [SG2,3].
(a) Explain the working of a 2-to-4 decoder circuit shown in Figure 4.29 of [SG2,3].
(b) Draw the circuit diagram for a 1-to-2 decoder circuit.
[Helpful Pointer: In these circuit diagrams, it is useful to draw all the input signals (both X and ~X) as vertical lines on the left side of the circuit diagrams -- as shown in Figures 4.29 or 4.26. This makes your circuit neater and easier to "debug" or spot mistakes.]

T7-D4: (1-bit Memory Unit)
Explain the working of a 1-bit memory unit (also called a flip-flop). (Read the last part on lecture notes (2008-04a-hardware.ppt) on sequential circuits and the flip-flop.)




Problems to be Handed In for Grading by the Deadline:
(Note: Please submit hard copy to me. Not just soft copy via email.)

T7-Q1: (Sound and Image) (Problem 11 of Ch. 4 of [SG3].)
(a) How many bits does it take to store a 3-minute song using an audio encoding method that samples at the rate of 40,000 samples/second, has a bit depth of 16, and does not use compression? What if it uses a compression scheme with a compression ratio of 5:1?
(b) How many bits does it take to store an uncompressed 1,200 x 800 RGB colour image? If we found out the the image actually takes only 2.4Mbits, what is the compression ratio?

T7-Q2: (15 points) [8-input multiplexor]
Extend T6-D2 to design an 8-input MUX. It will have three input lines.
(See helpful pointer above on drawing circuits and for simplicity, you can make use of 3-input OR/AND gates.)

T7-Q3: [Simple Logic Circuit Design -- Majority-Rules]
Build a majority-rules circuit. This is a circuit that has 3 inputs and one output. The value of its output is 1 if and only if two or more of its inputs are 1; otherwise, the output of the circuit is 0. For example, if the 3 inputs are 0, 1, and 1, your circuit should output a 1. If its 3 inputs are 0, 1, 0, it should output a zero. This circuit is frequently used in fault-tolerant computing -- see Problem 19 of Ch.4. of [SG2,3] for more details.

T7-Q4: (5 points) (Why DMO)
Assume that a 1 gigaflop machine (does 230 floating-point operations per second) is connected to a printer that can print 780 characters per second. In the time it takes to print 1 page (65 lines of 80 characters per line), how many floating-point operations can the machine perform?
(Note: 1 flop is 1 floating-point operation)


A-Problems: OPTIONAL Challenging Problems for Further Exploration

A7: (Really LARGE numbers) The running times for some entries in the table in T5-Q4 would cause overflow in your calculators -- and so, it was given as "too big to compute". Use your ingenuiety (and knowledge of mathematics) to find a way (actually, also an algorithm) to compute these with the help of calculators.
(Hint: John Napier, 1614)

A8: (Limits of Floating Point Numbers)
(a) Using 24 bits to represent the mantissa (sign/magnitude) and 8 bits to represent the exponent (also sign/magnitude), we know that we can only represent a small subset of the real numbers. What is the largest number (and smallest number) that can be represented.
(b) The gap (i.e., difference in value) between two consecutive real numbers also varies. What is the smallest gap between two consecutive real numbers? What is the largest gap between any two consecutive real numbers?


UIT2201: CS & IT Revolution; (Spring 2008); A/P Leong HW