数电入门

自用学术垃圾桶

Number and Code

Numerical Systems

Coding

Applications

Race and Hazard

Race: time delay between parallel signals Hazard: race causing incorrect transient output Hazard in $C+\bar{C}, C\bar{C}$ happens when switching from a variable to its complement (time delay). $Y=A\bar{C}+\bar{A}B+\bar{A}C$, both $A$ and $C$ have race; e.g. when $B=1,C=0$, $A$ arises hazard. Tangent circles in the K-map arises hazard.

How to avoid static hazard?

  1. modify logic design, add redundant terms $Y=B\bar{C}+AC\rightarrow Y=B\bar{C}+AC+AB$ (eliminate tangent circles)
  2. enable signal
  3. filtering

Sequential Logic

Latches and Flip-flops

  • all logics for S-R latch are reversed when using NAND (negative-OR)
  • pay special attention to negative inputs: gated S-R latch inverts inputs so that they’re still active-high
  • inverting bubbles can move along a line and cancel each other
  • 对于negative input,可以$\overline{\text{input}}=\text{input_new}$,直接化为对应的negative output
  • 可以通过工作时段判断类型: posedge-triggered FF对应slave在反时钟的low/posedge工作, 即为NOR型, 反之则为NAND型; master相反

What is sequential logic?

实际上是将时序逻辑按状态机考虑,分离为迭代过程($Q^n\rightarrow Q^{n+1}$)与组合逻辑(f(状态,输入/控制变量), 表达式, 列表与k-map是不同的表示方式). 复杂问题建议用K-map, 输入为自变量, 输出为所求因变量.

Find $S,R$ or $D$ or $J,K$ for the logic relationship to organize it in form of the drive equation

Conversion between FFs: $\text{drive variable}=f(Q(\text{combination logic}))=g(\text{drive variable’})$ 可以出现反馈回路形式的输入, 只要组合逻辑关系符合即可

  JK T D
JK $J=Q^{n+1},K=\bar{Q^{n+1}}$ $J=K=T$ $J=D,K=\bar{D}$
T $T=J\bar{Q^n}+KQ^n$ $T=Q^n\oplus Q^{n+1}$ $T=D\oplus Q^n$
D $D=J\bar{Q^n}+\bar{K}Q^n$ $D=T\oplus Q^n$ $D=Q^{n+1}$

Propagation Delay

Applications

Sequential Logic Analysis

analysis steps:

  1. combinational: Write down the drive equation of each FF and the output
  2. sequential: Substitute the drive equation into each state equation and find out the state transition relationship $Q^{n+1}=f(X,Q^n)$

design steps:

  1. define, simplify and assign states
    • simplify: eliminate equivalant states with same output and equivalent next state (隐含表法列举等价条件逐步排除); 注意mealy是X/Z, 而moore是Q/Z
    • assign and encode: state = combinations of outputs (from flip-flop output) $A_{2^{FF}}^k$, $2^{FF}\ge \text{output bits}$; adjacent assignment method (same next state>last state>output)
    • now we have a state transition diagram $Q^{n+1},Z=f(X,Q^n)$
  2. get expressions of FF drive variables $g(X,Q^n)$ from $Q^{n+1,n}$ using
    • directly substituting drive equation
    • mechanically listing truth table
    • k-map, just flip x and y; 或者从状态图的k-map中直接挑出每个状态对应的形式,不起效的部分填上x
    • 自启动,就是保证所有x取的次态都接到主环上
  3. 对于寄存器式counter状态迁移必须满足移位条件(只变首尾,单向传输),把所有状态连到一个环上

Integrated Circuits

Diode

MOSFET

back