Computer Architecture

Start Lecture #9

Homework: 36

SRAMS and DRAMS

Note: There are other kinds of flip-flops T, J-K. Also one could learn about excitation tables for each. We will not cover this material (P&H doesn't either). If interested, see Mano.

B.6: Finite State Machines (FSMs)

More precisely, we are learning about deterministic finite state machines or deterministic finite automata (DSA). The alternative nondeterministic finite automata (NDA) are somewhat strange and, althought seemingly nonrealistic and of theoretical value only, form together with DFA, what I call the secret weapon used in the first stage of a compiler (the lexical analyzer.

I do a different example from the book (counters instead of traffic lights). The ideas are the same and the two generic pictures (below) apply to both examples. state machine

Counters

A counter counts (naturally).

The State Transition Diagram
The circuit diagram.
Determining the combinatorial circuit

How do we determine the combinatorial circuit?

Current      || Next A
   A    I R  || DA <-- i.e. to what must I set DA
-------------++--      in order to get the desired
   0    0 0  || 0      A for the next cycle.
   1    0 0  || 1
   0    1 0  || 1
   1    1 0  || 0
   x    x 1  || 0

But this table is simply the truth table for the combinatorial circuit.

A I R  || DA
-------++--
0 0 0  || 0
1 0 0  || 1
0 1 0  || 1
1 1 0  || 0
x x 1  || 0

DA = R' (A ⊕ I)

A 2-bit Counter.

No new ideas are needed; just more work.

To determine the combinatorial circuit we could precede as before

  Current      ||
    A B   I R  || DA DB
  -------------++------

This would work (start it on the board), but we can instead think about how a counter works and see that.

    DA = R'(A ⊕ I)
    DB = R'(B ⊕ AI)
  

A 3-bit Counter

Homework: B.39

B.7 Timing Methodologies

Skipped

Simulating Combinatorial Circuits at the Gate Level

The idea is, given a circuit diagram, write a program that behaves the way the circuit does. This means more than getting the same answer. The program is to work the way the circuit does.

For each logic box, you write a procedure with the following properties.

Simulating a Full Adder

Remember that a full adder has three inputs and two outputs. Discuss FullAdder.c or perhaps FullAdder.java.

Simulating a 4-bit Adder

This implementation uses the full adder code above. Discuss FourBitAdder.c or perhaps FourBitAdder.java

Chapter 1: Computer Abstractions and Technologies

Homework: READ chapter 1. Do 1.1 -- 1.28 (really one matching question)
Do 1.29 to 1.45 (another matching question),
1.46.

Chapter 2: Instructions: Language of the Machine

Homework: Read sections 2.1, 2.1, and 2.3 (you need not worry about how a compiler works, but you might want to).

2.4 Representing instructions in the Computer (MIPS)

The Register File

The fields of a MIPS instruction are quite consistent

    op    rs    rt    rd    shamt  funct   name of field
     6     5     5     5      5      6     number of bits
  

R-type Instructions (R for register)

Example: add $1,$2,$3