CSCI 2150
Fall 2000 Test 2 -- Answers
The following is the answers to the Fall 2000 CSCI 2150
Test 2. In some cases, where the HTML does not prohibit it,
I've elaborated on the process to get to the answers.
- Show the D flip-flop output waveform Q for the inputs D and CLK indicated in the figure
below. (Assume the flip-flop captures on the rising edge.)
Answer: The answer is in red in the figure below.
- How many D flip-flops will you need to represent a state diagram
with 9 states? (i.e., what is the minimum number of bits you will need
to number 9 states?)
Answer: 4 -- If you number the states, you should come up with a list
going from 0 to 8. And what is 8 in binary? 1000. Since it
takes 4 bits to represent 8, then four flip-flops are going to
be required to remember 9 distinct states. Another way of looking
at it is that 1 flip-flop can remember 21=2 states,
2 flip-flops can remember 22=4 states,
3 flip-flops can remember 23=8 states, and
4 flip-flops can remember 24=16 states. 1, 2, and 3
are not enough. Four is the first value that has more than
9 possible states.
- Create the next state truth table from the state diagram
below. Make sure you label the bits of your states using the
state numbers from the diagram.
Answer:
Next State Table |
Current State
|
Next State
|
S2 |
S1 |
S0 |
S2' |
S1' |
S0' |
0 | 0 | 0 | 1 | 1 | 0 |
0 | 0 | 1 | 0 | 0 | 0 |
0 | 1 | 0 | 0 | 1 | 1 |
0 | 1 | 1 | 1 | 0 | 1 |
1 | 0 | 0 | 0 | 0 | 1 |
1 | 0 | 1 | 1 | 1 | 1 |
1 | 1 | 0 | 0 | 1 | 0 |
1 | 1 | 1 | 1 | 0 | 0 |
- The top half of each node in the
state diagram to the right represents the state number and the
bottom half shows the output for that state. If the current state
is 01 and the input D equals 0, what is the next state and the
new output value after the state change?
Answer: If the current state is 01 and D=0, then after a clock
pulse, the state machine will head to state 10. The output for
that state is 0.
- The two Boolean expressions below represent the next state
(S0' and S1') based on the current state (S0 and S1). Draw the logic
circuit for the state machine.
Answer:
S0' = (S0 ^S1) + (^S0 S1)
S1' = (^S0 ^S1) + (S0 S1)
Answer:
- Write the Boolean expression for X represented by the PLA diagram below.
Answer: X = (A B C) + (A ^B ^C) + (^A ^B C)
- What is the value at the output Y of the 1-of-8 multiplexer shown to the right?
(Figure omitted in key.)
Answer: From the circuit, we can see that S2=0, S1=1,
and S0=1. Since we assume that S2 is the considered
the most significant bit, then the selection inputs make the binary value
0112. This is equivalent to the decimal value 3. Therefore,
D3 (which is equal to 0) is routed to the output Y. The final
answer (the only thing that you actually needed to write down for full credit) is
0.
- Draw the decoding logic for an active-LOW output for
the input A0 = 0, A1 = 1, A2 = 1,
A3 = 0, and A4 = 1.
Answer: An active low decoding logic, otherwise known as a chip select
circuit, is created using a NAND gate where the inputs that are supposed
to equal 0 are inverted before being input to the NAND gate and the
inputs that are supposed to equal 1 are connected straight into the NAND
gate. This gives us the following circuit:
- A tristate output buffer has an additional state other than logic 1 and logic 0.
What does that state do?
Answer: This state, identified in class as Z,
is called high-impedance. It is designed to disconnect the outputs of
an IC such as a memory chip so that it is not trying to put a logic 1 or
0 on a wire while another chip is supposed to be controlling the wire.
It is almost like a switch that physically disconnects an output from
a circuit.
- Circle all the memory types below that are non-volatile.
- Battery-backed SRAM
- Flash RAM
- Custom-masked ROM
- EEPROM
- OTPROM
- EPROM
Answer: a, b, c, d, e, and f (all of them)
- Circle all the memory types below that require a
special programmer for programming.
- Battery-backed SRAM
- Flash RAM
- DRAM
- EEPROM
- OTPROM
- EPROM
Answer: e and f (d can be programmed
with a programmer, but it is not required)
- Circle all the memory types below that can be written to multiple times.
- Battery-backed SRAM
- Flash RAM
- Custom-masked ROM
- EEPROM
- OTPROM
- EPROM
Answer: a, b, d, and f
- How many address lines does a processor with a
128K memory space have?
Answer: Since 217 = 128K (131,072), then the processor must have
17 address lines.
- Can a 16K memory chip have a starting address of 3C00016?
Answer: First, we need to determine how many address lines
it will take to address 16K. Since 214 = 16K
(16,384), then it takes 14 address lines. Therefore, the
the 14 least significant places in the low or starting address
MUST be zero. Therefore, we next convert 3C00016
to binary and get 0011 1100 0000 0000 00002.
Counting from the right, we see that there are 14 zeros before
you get to the first 1. Therefore, a 16K memory chip
can have a starting address of
3C00016.
- What is the high address IN HEX for an 8K ROM with a
low address of 400016?
Answer: Once again, we need to figure out how many address
lines an 8K memory device requires. Since 213 = 8K (8,192),
then an 8K device has 13 address lines. Therefore, the 13 least
significant or 13 rightmost bits of the address range for an 8K
ROM must be 0's for the low address and 1's for the high
address. Since our low address is 400016 which equals
0100 0000 0000 00002 in binary, then the low address
is 0101 1111 1111 11112 (simply 0100 0000 0000 00002
where the last 13 bits have been changed to 1's). In hex, this
is 5FFF16.
- Design the chip select for a 32K RAM placed in a
1MEG memory space with a low address of 7800016.
Answer: First, how many address lines will a 32K memory device
require? Well, since 215 = 32K (32,768), then it
requires 15 address lines.
Next, we need to figure out how many address lines total come
from the processor to make a 1 MEG memory space. Since 220
= 1 MEG (1,048,576), then the processor has 20 address lines,
A0 through A19.
Third, we need to determine the bits required for the chip select.
Begin by converting the low address of the memory device to binary:
7800016 = 0111 1000 0000 0000 00002.
(Note that the leading zero was added because the processor has
20 address lines.) Since 32K requires 15 address lines, then the
remaining lines, 20-15=5, will be used for the chip select. This
means that the 5 most significant address lines, A19,
A18, A17, A16, and A15,
will make up the chip select.
From the binary value for the low address, we see that A19=0,
A18=1, A17=1, A16=1, and A15=1.
This gives us the circuit:
Created by David Tarnoff for use by his sections of CSCI 2150.