Computer-Aided Digital System Design Notes

Computer-Aided Digital System Design

Course Information

  • Instructor: Dr. Rajabi
  • Email: ali.rajabi.student@gmail.com

Grading Breakdown

  • Homework & Midterm: 25%
  • Project: 25%
  • Final Exam (minimum 50%): 50%

Course Content

  • Introduction and Basic Concepts
  • Hardware Description Languages (HDLs)
    • VHDL
    • Verilog
    • System C
  • Hardware Synthesis
    • XILINX ISE
    • Quartus II
  • Digital System Design with PLDs

References

  • Digital System Computer Design
    • Author: Dr. Morteza Saheb Zamani
    • Professor at Amirkabir University of Technology
  • VHDL
    • From Simulation to Synthesis
  • Digital Circuit Auto Design With VHDL & FPGA Hardware Description Language
    • Authors: Dr. Hassan Seyed Razi, Abdolkarim Zomri
    • Faculty of Electrical and Computer Engineering
    • Tehran University - Faculty of Engineering
    • Includes CD-ROM with Xilinx WebPack 5.2 and Active-HDL 6.1 software
  • Circuit Design with VHDL
    • Author: Volnei A. Pedroni
    • Third Edition
  • VHDL Modular Design and Synthesis of Cores and Systems
    • Author: Zainalabedin Navabi, Ph.D.

Digital Circuits

  • Foundation: Digital computers and automatic control systems.
  • Applications:
    • Smart Homes: Remote control, heating/cooling systems, smart locks.
    • Electric Vehicles: Safety features, self-driving capabilities, energy management.
    • Medical Field: Disease diagnosis, health monitoring.

Digital vs. Analog Electronics

  • Digital Electronic:
    • Digital signal processing circuits.
    • Represented by 0 (Low, False).
  • Analog Electronic:
    • Analog signal processing circuits.
    • Represented by 1 (High, True).
  • Voltage Representation:
    • Analog: Continuous change, U(T):[a:b]U(T) : [a : b]
    • Digital: Discrete values, X(N):0,1X(N) : {0,1}

Nature of Signals

  • Natural signals like voice, music, and vision are analog, existing in continuous form.

Analog-to-Digital Conversion (A/D)

  • Reasons for Conversion:
    1. Data Interpretation & Saving
    2. Telecommunications
    3. Digital Signal Processing (DSP)
    4. Ease of Production, Processing & Storage
    5. Use of 0 and 1 instead of a wide range of numbers

Analog vs. Digital Signals

  • Analog: 75
  • Digital: 0 1 0 0 1 0 0 0 (Digital String)
  • Voltage Levels:
    • Usually +5V: On
    • Usually 0V: Off
    • Analog Range: [0 : 0.8] and [3 : 5]

Switches

  • Manual Mechanical Switches
  • Electromechanical Switches
  • Electronic Switches
Ohmmeters
  • R=∞R = \infty (Normally Open)
  • R=0R = 0 (Normally Closed)
Components
  • Industrial Materials Coil
  • Diodes (P-N Junction)
    • Anode (+)
    • Cathode (-)
  • Transistors
    • Collector
    • Base
    • Emitter

Abstraction Level

  • ISA (Instruction Set Architecture):
    • Instructions, Registers, Addressing Modes, Memory Architecture
  • Software:
    • Application Software (e.g., C, Java)

Full Adder Design

  • Requirements:

  • Abstraction
    S=Cin⊕A⊕BS = Cin \oplus A \oplus B
    Cout=AB+Cin(A⊕B)Cout = AB + Cin(A \oplus B)

  • Truth Table

Abstraction in Digital System Design

  • Abstraction: Multiple descriptions and definitions of a system or topic.
  • Digital System Design: The process of creating and managing multiple descriptions of a system with different abstractions.

PLD: Programmable Logic Device

  • Small Scale
  • Larg Scale

Full Adder Entity Definition (VHDL)

entity Full_Adder is
    Port (
        A   : in  STD_LOGIC;  -- First input bit
        B   : in  STD_LOGIC;  -- Second input bit
        Cin : in  STD_LOGIC;  -- Carry-in bit
        Sum : out STD_LOGIC;  -- Sum output
        Cout: out STD_LOGIC   -- Carry-out output
    );
end Full_Adder;

architecture Behavioral of Full_Adder is
begin
    -- Process to compute sum and carry-out
    process(A, B, Cin)
    begin
        -- Sum is A XOR B XOR Cin
        Sum  <= A XOR B XOR Cin;
        -- Carry-out is (A AND B) OR (B AND Cin) OR (A AND Cin)
        Cout <= (A AND B) OR (B AND Cin) OR (A AND Cin);
    end process;
end Behavioral;

Programmable Logic Devices (PLDs)

  • PLDs are programmed according to user needs (e.g., image processing, Fourier transform).
  • PLDs contain thousands or millions of basic logic gates and programmable logic functions.
  • PLD architectures include SPLD, CPLD, FPGA, and ASIC.
  • PLDs are typically provided with programming software by the manufacturer.
  • Programming software such as Quartus (Intel) and XILINX ISE are used for PLD programming.
  • VHDL and Verilog are common programming languages for PLDs.

Clock Signals

  • Clock: A precise timing signal is essential for most digital circuits.
  • Synchronization: Clock signals synchronize different parts of a digital system.
  • Waveform: Often a square wave with a specific frequency.
  • tp=1/ftp = 1/f

Logic Gates

  • OR Gate: X=AORBX = A OR B
  • AND Gate: X=ABX = A B

Timing Waveform Analysis

Timing Analysis with Bypass Inputs

Timing Analysis with Don't Care Inputs

Timing Simulation

Digital Circuits Classification

  • Logic Standard
  • Logic Microprocessor & RAM
  • PLDs
  • Gate Arrays
  • Cell-Based ICs
  • Full Custom ICs
PLD Types
  • SPLD: Simple Programmable Logic Device (e.g., PALs)
  • CPLD: Complex PLD
  • FPGA: Field Programmable Gate Array
  • ASIC: Application Specific Integrated Circuit

IC Layout

  • Element arrangement in rows
  • Port arrangement above and below cells (new technology on cells)
IC Types
  • Standard Logic
  • Full Custom ICs
  • Semi-Custom ICs
  • Gate Arrays

PLD: Programmable Logic Devices

  • PLDs are electronic components used to build digital circuits.
  • Unlike logic gates with fixed functions, PLDs have undefined functions at manufacture.
  • PLDs must be programmed before use.
Design Considerations
  • Speed
  • Density
  • Complexity
  • Market Volume
  • Engineering cost
  • Time to develop the product

Programmable Technologies

  • ONE-TIME Programmable:
    • Fuses
    • Anti-Fuses
    • PROM Link
Fuse Technology
  • Link
Anti-Fuse Technology
  • Link
  • More Popular

Anti-Fuse Technology

Advantages
  • No external memory
  • Very small area
  • High reliability (TDDB: 40 years)
  • Low on-state resistance
  • Low parasitic capacitance
  • High design security
  • Very low power consumption
Disadvantages
  • Cannot be reprogrammed
  • Requires auxiliary circuitry for high voltage and current

Reprogrammable Technologies

  • EPROM, EEPROM, FLASH
EEPROM Cell
  • Normal MOS Transistor vs. EEPROM Transistor

Reprogrammable: Erasable PROMs

  • Erasable PROM (EPROM):
    • UV light to erase the entire device (approximately 10 minutes)
  • Electrically Erasable PROM (EEPROM):
    • Similar technology to UV EPROM
    • Erased in blocks by higher voltage
    • Slower programming than reading
  • Flash Memory:
    • Digital cameras, MP3 players, BIOS
    • Limited life
    • Some support individual word write, some block
    • Has a boot block that is carefully protected

SRAM: Static RAM Reprogrammable.

  • Read or Write Data Configuration Control
  • SRAM Cell Needs 5 Transistors. Needs 2 transistors
Advantages:
  • Fast reprogramming
  • On-chip programming an unlimited number of times
  • Prototyping within the design cycle
  • Ability to test all paths by reprogramming the FPGA by the manufacturer
  • The user does not need to create test patterns and DFT circuits.
Disadvantages:
  • Size: Requires 5 transistors in the simplest possible case.
  • Requires external memory
  • Low security of the design against theft (Intellectual property).
  • High power consumption

Static vs. Dynamic RAM

Static RAM (SRAM)
Dynamic RAM (DRAM)
  • Memory stored in capacitors
  • Capacitor discharges over time or when memory is read
  • Requires refreshing of data (manually or through auxiliary circuitry)
  • Small and suitable size

PLD Types (Revisited)

  • SPLD: Simple Programmable Logic Device
    • LSI device (less than 1000 logic gates)
    • PLA or PAL
    • Fixed internal routing, deterministic propagation delays
  • CPLD: Complex PLD
    • VLSI device (higher logic capacity than SPLDs)
    • Multiple SPLDs on a single chip
    • Programmable interconnect
  • FPGA: Field Programmable Gate Array
    • VLSI device (higher logic capacity than CPLDs)
    • An array of logic blocks
    • Large number of gates, user-selectable interconnection, delays depending on design and routing
    • A high ratio of flip-flops to logic resources

SPLD Architectures

  • Programmable Logic Array (PLA)
  • Programmable Array Logic (PAL)
  • General Array Logic (GAL)
  • Others

Architectural Differences

  • AND versus OR implementation
  • Programmability (e.g., EE)
  • Fundamental logic block

SPLD: Simple Programmable Logic Device

  • SOP: Some Off Product

  • PLA: Programmable AND array, Programmable OR array

  • PAL: Programmable AND array, Fixed OR array

SPLD Example

  • Logic Function Example
    F=ABC′+AD+A′DF = ABC' + AD + A'D
    G=ABC+ABC′+A′DG = ABC + ABC' + A'D
    H=ABC+BDH = ABC + BD
    J=B+ADJ = B + AD

SPLD Example

  • Logic Function Example
    F1=X1X2X3′+X1′X2′X3F1 = X1X2X3' + X1'X2'X3
    F2=X1′X2′X3′+X1X2X3F2 = X1'X2'X3' + X1X2X3

SPLD-PAL

  • Feedback is used if the number of products exceeds the number of AND gates.
  • Deactivating the NOT in the outputs with three-way NOTs deactivates the corresponding output.
  • PAL 16L8 (Number of inputs, Architecture Number of Outputs (or flip-flops), Speed ​​grade Power Level)

PAL Outputs

  • Typical PALs have:
    • From 10 to 20 inputs
    • From 2 to 10 outputs
    • From 2 to 8 AND gates driving each OR gates
    • Often includes D flip-flops
  • Multipexer: For having a sequential circuit near a combinational circuit; we use flip-flops.

PAL Products Term

  • This looks like an AND gate with one input. It is actually many more:
  • Drawn with a single line to save space.

PAL Example

  • Function implementation example
    P′=A′BGH′+CD′+HIJ+BG′HP' = A'BGH' + CD' + HIJ + BG'H

CPLD

  • PALs and GALs are available only in small sizes
    • Equivalent to a few hundred logic gates
  • For bigger logic circuits, complex PLDs or CPLDs cab be used
    • Linked by programmable interconnections
    • All in one integrated circuit (IC)
  • CPLDs can replace thousands, or even hundreds of thousands, of individual logic gates
    • Increased integration density

CPLD Architecture

  • I/O Block
  • Cell
  • Programmable Interconnect Array
  • Flip Flop
  • Multiplexer
  • Buffer
  • XOR
  • SRAM Controlled NOT

Programmable Interconnect Array

  • Consists of connectors that run throughout the CPLD to connect the microcells in each labs.
  • The PIA also connects the AND gate and other elements of the microcells
  • E2CMOSTransistor:OFForON(0or1)E^2 CMOS Transistor: OFF or ON (0 or 1)

Field Programmable Logic Array (FPGA)

  • 2-D array of logic blocks and flip-flops with programmable interconnections
  • User can configure:
    • Intersections between the logic blocks
    • The function of each block
  • FPGAs are usually programmed after being soldered down to the circuit board, in the same way as larger CPLDs
  • In most larger FPGAs the configuration is volatile and must be re-loaded into the device whenever power is applied or different functionality is required

FPGA vs Microcontroller

  • Microcontrollers are designed and manufactured like microprocessors with Full Custom in smaller sizes.
  • In microcontrollers, the user does not have access to the hardware of the microcontroller.
  • In microcontrollers, the user does not have the ability to create his desired functions.
  • In microcontrollers, the user only has the possibility to code. Coding in microcontrollers is done serially (line by line).

FPGA vs Microcontroller : Architecture Diagram

  • Microcontroller
  • FPGA Board External Pins

Logic Blocks

  • IOBlock
  • Logic Block Interconnection switched
  • Purpose: to implement combinational and sequential logic function.
  • Logic blocks can be implemented by:
    • Transistor pairs
    • Multiplexers
    • Look up tables (LUT)
    • Wide fan-in AND-OR structure
  • Granularity: is the hardware abstraction level. According to granularity, two types of blocks:
    1. Fine-grain logic blocks (ex: NAND gates or simple transistor) High cost to program external connections in small size
    2. Coarse grain logic blocks

Look-Up Table (LUT)

  • 2-input LUT example:
  • With this method, you can implement the functions you need.

Look-Up Table (LUT) Example

Look-Up Table (LUT): Multiplexer Implementation

Example of Look -Up Table (LUT)

  • Output of SRAM gives the logic output
  • K-Input logic function=2K{K} size SRAM
  • K-Input LUT gives 22K{K} logic function

Example of Look-Up Table (LUT)

Example of Look-Up Table (LUT)

  • Example: Implement the given truth table using 3 − LUT .

Example of Look-Up Table (LUT)

  • Example: Implement the given truth table using 4 − LUT .

Look-Up Table (LUT) design Considerations.

  • In order to make optimal use of the available capacity, LUTs are not usually made very large.
  • Most logic functions have 4 to 6 inputs, which is why LUTs are usually built with sizes 4 to 6.
  • In the design and use of LUTs, the more LUTs are increased (using smaller LUTs), the more external connections are needed.
  • As a result, for the selection of LUTs, the design must be such that all available LUT capacities are used and, as far as possible, the increase of external connections is avoided

Programmable Switch Matrix (PSM)

  • Six-pass transistor per switch matrix interconnect point
    Six→SRAMSix → SRAM and SRAM→5TransistorsSRAM → 5 Transistors therefore Six Transistor S→TransistorS → Transistor therefore 36 Transistors.

SRAM-Based FPGA: Diagram/Photo

  • Logic Block
  • Switch Block
  • I/O Block
  • Routing chanle

Routing Criteria

  • CB LC LC SB CB SB CB LC LC SB CB SB
  • (Connection Block,Logic Connection,Logic Connection,Switch Block….etc.)
  • The main space of FPGs is occupied by connecting resources.
  • By reducing the connection resources, the ability to implement different circuits is also reduced.
  • By increasing the connecting resources, a lot of chip space is occupied by these resources.
  • By increasing the connection resources, less space remains for the logic parts.
  • By increasing the number of connection resources, logic parts are reduced.

Routing Criteria: Definitions

  • Segment Wire: A piece of wire that is connected to a programmable switch.
  • One or more switches can be connected to a Segment Wire.
  • Track: we call a sequence of one or more Segment Wires along a line a Track.
  • Channel: Parallel Track groups form Channels.
  • Block Connection: The connection from the inputs and outputs of an LC to the segment Wires of a Channel is called Block Connection.
  • Block Switch: The connection between horizontal and vertical segment Wires is done by Block Switches.

Example: 1-bit Full Adder :Implementation Using MUX.

  • Inputs Outputs
    A B Cin S Cout
    0 0 0 0 0
    0 0 1 1 0
    0 1 0 1 0
    0 1 1 0 1
    1 0 0 1 0
    1 0 1 0 1
    1 1 0 0 1
    1 1 1 1 1
Various Truth Tables.

SUM / Minterms Table (K − Map) B′Cin ′ B′Cin BCin B Cin ′
A′ 1 1
A 1 1

COut/ Minterms Table(K − Map) B′Cin ′ B′Cin BCin B Cin ′
A′ 1
A 1 1 1

SUM = (A′B′Cin) + ( A′B Cin ′)+(A B′Cin ′)+(A B Cin)
Cout=(B Cin) +(A B) + (A Cin)
1 bit Full adder A B Cin S Cout Black Box Truth Tabel
Sum = A ⊕ 𝐵 ⊕ Cin
Cout = A .𝐵 + A . Cin + B . Cin Logic Function

1-bit Full Adder Implementation with PLA

  • SUM = (A′B′Cin) + ( A′B Cin ′)+(A B′Cin ′)+(A B Cin)
  • Cout=(B Cin) +(A B) + (A Cin)

1-bit Full Adder Implementation with PAL

  • SUM = (A′B′Cin) + ( A′B Cin ′)+(A B′Cin ′)+(A B Cin)
  • Cout=(B Cin) +(A B) + (A Cin)

1-bit Full Adder Implementation with MUX.

  • Inputs Outputs A B S 0 0 𝐼0 0 1 𝐼1 1 0 𝐼2 1 1 𝐼3 Cin Cin ′ Cin ′ Cin

1-bit Full Adder using MUX (Continued)

1-bit Full Adder with MUX and Logic Gates

Example: Half Adder +Implementation Using Logic Gates

Truth Table::
  • Inputs Outputs A B S Cout A B 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1SUM / Minterms ∶ 1,2, ∶ 1) A′𝐵 2) A B′ SUM = (A′𝐵) + (A B′) . Output : A(+)B. Cout / Minterms ∶ 3 ∶ A B . Output : AB Logic Function

Example: Half Adder :PLA, PAL, Karnaugh-Map

  • Schematics of the Half Adder made of gates and with K-Maps

Example: Half Adder : Half Adder from 4-1 Mux, with truth table, and schematic of physical gates.