Block 1

Number System & Code

  1. Analog vs Digital

    Analog: have values across a continuous range

    • ambiguity

    Digital: only takes discrete values 0 and 1

    • only one interpretation
    • Flexibility
    • programmability
    • speed
    • economy
    • reproducing results
  2. IC(Integrated Circuits)

  3. Position Number System: Decimal, Binary, Octal, Hexadecimal

  4. MSD(MSB) & LSD(LSB)

  5. Conversion

    • to decimal: power
    • decimal to other bases: divide(Integer) & multiply(Fractional)
    • among any base that is any power of 2: group bits
  6. Arithmetic

    • carry & borrow
  7. Negative numbers

    • Sign-Magnitude Representation: sign bit
    • Two’s Complement: invert +1
    • Overflow
  8. Floating Point

    store both large and small numbers

    • IBM System 360/370: (1)s0.f16e64{(-1)^s0.f*16^{e-64}} s|7-bits e|24-bits f
    • DEC PDP 11/VAX: (1)s0.1f2e128{(-1)^s0.1f*2^{e-128}} s|8-bits e| 23-bits f
    • IEEE-754: (1)s1.f2e127{(-1)^s1.f*2^{e-127}} s|8-bits e| 23-bits f
    • excess-3 exponent code: (1)s1.f2e3{(-1)^s1.f*2^{e-3}} s|3-bits e|4-bits f
  9. Code

    • binary codes: use binary to represent data
    • BCD: use 4-bit binary to represent decimal
      • precise decimal math
      • more memory
    • Gray Code
    • ASCII
    • Unicode
  10. Parity Checking

    • a simple error detection, only 1 bit
    • Even-parity code: set the parity bit to 0 if there’s an even number of 1s
    • Odd-parity code: set the parity bit to 0 if there’s an odd number of 1s

Switching Algebra

  1. some very important theorems:

    • (X + Y)(X + Z) = X + YZ – when you meet a PoS problem, this is very useful

    • X(X + Y)=X <-- X + XY = X

    • XY + X’Z + YZ = XY + X’Z , (X + Y)(X’ + Z)(Y + Z) = (X + Y )(X’ + Z) Consensus “add a 1(X+X’) term to prove”

    • X + X’Y = X + Y <-- X(X’ + Y) = XY

    • Duality

    • De Morgan’s

    • Shannon’s

  2. find complement: duality + inverse

  3. minterm & maxterm

    • minterms always equal 1

    • maxtrems always equal 0

    • eg. XYZ, X+Y+Z, X’Y’Z, X’+Y’+Z --> m7, M0, m1, M6

    • M0=m0{M_0=\overline{m_0}}

  4. SoP & PoS

    • F = X’Y’Z’ + X’Y’Z + X’YZ’ + XY’Z’ + XY’Z – F=Σm(0,1,2,4,5)=ΠM(3,6,7){F=\Sigma m(0,1,2,4,5)=\Pi M(3,6,7)}

    • SoP -> PoS : find F’, complement again , simplify with De Morgan’s law

    • find standard SoP: multiply(X+X’) – use distributive theorem

    • find standard PoS: add(XX’) – use distributive theorem

Block 2

Logic Signals

  • Positive Logic
  • Negative Logic

Logic Family

  1. TTL

    • 0: 0-0.8V; 1: 2.0-5.0V
  2. CMOS

    • 0: 0-1.5V; 1: 3.5-5.0V
  3. Parameters

Tp{T_p}(ns) PP(mW) Noise Margin(mV) Fan-out
TTL 9 10 400 10
CMOS 18 0.01 1050(OH),1340(OL) <=50
  • Fanin: the number of inputs a gate can have

  • Fanout: maximun number of inputs an output can drive

  • Impedance

  • Propagation delay: the amount time needed for a input change produce an output change

  • Noise Margin: maximum external noise can be added to inputs that will not cause an undesired change

Karnaugh Maps

  1. why K-Maps:

    • simplify the combinational circuit --> find grouping of 1’s
  2. Prime Implicants

    • the size of each group is maximised
    • this makes a MSP(minimal SoP)
  3. EPIs

    • group containing a minterm that is not covered by other overlapping groups
  4. don’t care case

    d(X,Y,Z), can be grouped in 1’s groups

Hazards & Glitches

  1. Glitch: A momentary unexcepted output change (short pulse) when an input changes; usually caused by gate propagation delays

  2. Hazards

    A timing hazard exists in a combinational circuit when it produces an output glitch when one or more inputs change.

    • A static-1 hazard is a pair of input combinations that: (i) differ in only one input variable and (ii) both give a 1 output; such that it is possible for a momentary 0 output( 0 glitch ) to occur during a transition in the differing input variable – for SoP case

      Note: One variable changing will cause problem because there is a NOT Gate propagation delay which makes 2 AND Gates cannot change at the same time. Adding a redundant group holds the final output at the correct signal level. One variable changing happens when two 1s are neighbors in K-Map but are in 2 separate groups.

    • A static-0 hazard is a pair of input combinations that: (i) differ in only one input variable and (ii) both give a 0 output; such that it is possible for a momentary 1 output to occur during a transition in the differing input variable. – for PoS case

    • how to avoid it?

      add a redundant group

Block 3

Latch & Flip-Flop

  1. how many states or need how many FFs?

    state=2nstate=2^n

  2. Synchronous clocked sequential circuit/ synchronous clocked state machine?

    combinational circuit, state register, clock pulses

  3. metastability?

    happens when both inputs are halfway between 0 and 1

    not a valid state

    stay in metastability forever if there is no noise

    ->how to cause?

    caused by “asynchronous inputs” that do not meet flip-flop setup and hold times.

  4. oscillation & undefined

    SR->1 simultaneously–0,0 undefined

    SR->0–oscillation

  5. implement with NAND gates

  6. why Control line/ enable?

    control when SR can be changed/ written with new value

  7. why D Latch?

    eliminate the indeterminate state

    set and reset are always complement of each other

  8. Why Flip-Flop?

    eliminate Race conditions

  9. Why master-slave?

    Isolate output from input, output cannot change continuously with input

    Input must have a stable setup time

  10. Why JK Flip-Flop?

avoid indeterminate state

  1. catching behavior?

    JK are not held valid during the entire period when CLK is active for master

    1’s catching: output changes to 1 even though K is 1 J is 0 at the end of triggering pulse

    0’s catching: output changes to 0 even though K is 0 J is 1 at the end of triggering pulse

  2. why edge-triggered?

    only set outputs on clock pulse transitions

    solve catching behavior.

State Machine

  1. Moore & Mealy machine?

    Moore: output=F(current state)

    Mealy: output=F(current state, input)

  2. State machine?

    Next-state logic

    State memory/ State register

    Output logic

Block 4

Digital System Blocks

  1. Buses

  2. Selectors/ Multiplexers

    n-input m-bit

  3. Decoder/ Demultiplexer

    n to 2n{2^n}

  4. Magnitude Comparator

Arithmetic Units

  1. Half-adder

    • S=XY+XY{S=X\overline{Y}+\overline{X}Y}
    • C=XY{C=XY}
  2. Full Adder

    • S=XYCin{S=X\oplus Y\oplus C_{in}}
    • Cout=XY+XCin+YCin{C_{out}=XY+XC_{in}+YC_{in}}
  3. Parallel Adder

  4. Subtractor

    A-B=A+(B’+1)

    Bin=1{\overline{B_{in}}=1}

  5. Adder/Subtractor

    Control Function
    0 Add
    1 Subtract
  6. Arithmetic Unit

    Control Function
    postion1 position0
    0 0 A + 1
    0 1 A + B
    1 0 A - 1
    1 1 A - B

Memory

  1. Serial Access & Random Access

    • Serial Access

      • Store data bits in series
      • must travel from current position to new address passing addresses in between-- time consuming
      • can store large amounts data
    • Random Access

      • equal time to access any location
      • n-bit address
      • stores 2n{2^n} m-bit data
  2. Volatile & Non-volatile

    • Volatile
      • loses contents when the power is switched off
      • RAM
    • Non-volatile
      • always keeps its contents even though there is no power
      • ROM
  3. RAM(Random Access Memory)

    • SRAM(Static RAM)
      • Definition: Uses transistors to store a single bit of information and does not need to be refreshed periodically.
      • Uses bistable latching circuit to store data
      • volatile
      • more expensive
      • less dense
      • uses little power at low speeds
    • DRAM(Dynamic RAM)
      • Definition: Uses a capacitor to store the data bit and needs to be periodically refreshed to maintain the charge in the capacitors.
      • Uses a capacitor and a single transistor for each bit
      • volatile
      • has to be continually refreshed
      • slower
      • high densities
      • main memory in PC
  4. ROM(Read Only Memory)

    • Non-volatile
    • contents cannot be changed by normal CPU operations
    • store fixed data or information
    • PROM: Programmable ROM
    • EPROM: Erasable PROM
    • EEPROM: Electrically Erasable PROM
  5. Memory Size

    • 1k=1024=210{2^{10}}

Microcomputer

  1. control signals
    • Read/ Write
    • Chip Select
    • Output Enable
  2. RAM: working memory
  3. ROM: storing OS