DSD UNIT 4
DSD UNIT 4
An IC that contains large numbers of gates, flip-flops, etc. that can be configured by the user
to perform different functions is called a Programmable Logic Device (PLD).
One of the simplest programming technologies is to use fuses. In the original state of the
device, all the fuses are intact.
Programming the device involves blowing those fuses along the paths that must be removed
in order to obtain the particular configuration of the desired logic function.
PLDs are typically built with an array of AND gates (AND-array) and an array of OR gates (OR-
array).
Advantages of PLDs:
There are three fundamental types of standard PLDs: PROM, PAL, and PLA.
A fourth type of PLD, which is discussed later, is the Complex Programmable Logic Device
(CPLD), e.g., Field Programmable Gate Array (FPGA).
A typical PLD may have hundreds to millions of gates.
In order to show the internal logic diagram for such technologies in a concise form, it is
necessary to have special symbols for array logic.
Figure shows the conventional and array logic symbols for a multiple input AND and a
multiple input OR gate.
The three fundamental types of PLDs differ in the placement of programmable connections in
the AND-OR arrays. Figure shows the locations of the programmable connections for the
three types.
The PROM (Programmable Read Only Memory) has a fixed AND array (constructed as a
decoder) and programmable connections for the output OR gates array. The PROM
implements Boolean functions in sum-of-min terms form.
The PAL (Programmable Array Logic) device has a programmable AND array and fixed
connections for the OR array.
The PLA (Programmable Logic Array) has programmable connections for both AND and OR
arrays. So it is the most flexible type of PLD.
Definition:
ROM is a type of non-volatile memory that is permanently programmed during
manufacturing to store data or instructions. This data is usually critical for the functioning of
a system and is not meant to be altered during normal operation.
Characteristics of ROM:
Data Storage: ROM consists of an array of memory cells. Each cell is connected to a
grid of rows (word lines) and columns (bit lines).
Pre-Programming: During manufacturing, specific connections in the memory cells
are created or left open, representing binary data (1 or 0).
Access: When a specific address is input, the ROM retrieves the corresponding data
for processing.
Types of ROM:
Applications of ROM:
Definition:
PROM is a special type of ROM that is manufactured as blank and can be programmed once
by the user. After programming, it behaves like ROM, with data becoming permanent.
Characteristics of PROM:
1. One-Time Programmable (OTP): Data can be written once and cannot be erased or
modified.
2. User-Programmable: Unlike ROM, which is pre-programmed, PROM allows
manufacturers or developers to program it based on specific needs.
3. Customizable: Suitable for creating unique configurations without modifying the
hardware design.
Blank Memory Cells: PROM contains memory cells that are initially
unprogrammed, represented by a default state (1).
Programming: A special device called a PROM programmer applies high voltage
to selected memory cells, "burning" fuses or links to permanently change their state to
0.
Read-Only: Once programmed, the PROM behaves like ROM, and its data is fixed.
Applications of PROM:
Advantages of ROM:
Limitations of ROM:
Advantages of PROM:
Limitations of PROM:
Structure of a PLA:
1. AND Plane:
o This is a matrix of AND gates.
o The inputs are connected to this plane, and the output of the AND plane
generates a set of intermediate signals, often called product terms.
2. OR Plane:
o This is a matrix of OR gates.
o The product terms from the AND plane feed into the OR plane, where they are
combined to generate the final output.
Working of a PLA:
1. Input Processing:
o The input variables (and their complements) are fed into the programmable
AND plane.
2. AND Plane:
o Specific combinations of inputs are selected (programmed) to form
intermediate product terms.
3. OR Plane:
o The product terms are selectively combined to produce the desired output
logic functions.
4. Output:
o The outputs represent the implemented logic expressions.
Features of PLA:
1. Fully Programmable:
o Both the AND and OR planes can be programmed, offering maximum
flexibility.
2. High Customizability:
o Designers can create almost any combination of logic functions.
3. Compact Design:
o A PLA can replace multiple discrete logic gates, saving space and simplifying
circuit design.
4. Reconfigurable:
o In some types, the programming can be modified during prototyping or
development stages.
Applications of PLA:
Advantages of PLA:
1. Flexibility:
o Allows designers to implement and change logic designs without hardware
modifications.
2. Time-Saving:
o Reduces the time to design and prototype circuits compared to fixed logic
gates.
3. Compact and Cost-Effective:
o Combines multiple functions into a single programmable device, reducing
hardware requirements.
Limitations of PLA:
2.
1. Input Buffers/Inverters:
o Inputs are passed through buffers and inverters, allowing both the input signal
and its complement to be available for programming.
2. Programmable AND Plane:
o A matrix of programmable connections that allows the designer to create
custom product terms by selecting combinations of inputs.
3. Fixed OR Plane:
o A non-programmable array of OR gates where each gate combines specific
product terms (outputs from the AND plane) to generate the desired output
logic.
4. Output Logic:
o Outputs may have additional features such as output enable controls or
optional flip-flops for sequential logic.
Working of a PAL:
1. Input Processing:
o Inputs (and their complements) are fed into the programmable AND plane.
2. AND Plane:
o Connections in the AND plane are programmed to form desired product terms
by combining selected input conditions.
3. OR Plane:
o The fixed OR plane combines these product terms as predefined logic
functions to generate the final output.
4. Output:
o The outputs represent the implemented logic functions, which can either be
purely combinational or include optional sequential behavior.
1. Partially Programmable:
o Only the AND plane is programmable; the OR plane is fixed.
2. Simplified Design:
o Fixed OR plane reduces complexity and makes the device easier to design and
use.
3. Speed Advantage:
o Faster than PLAs because the fixed OR plane is optimized for performance.
4. Cost-Effective:
o Less expensive than PLAs due to reduced programmability.
Applications of PAL:
Advantages of PAL:
1. Flexibility:
o Allows programming of the AND plane for custom logic functions.
2. Simplicity:
o Fixed OR plane simplifies design and reduces the chance of programming
errors.
3. Performance:
o Optimized for faster operations compared to fully programmable devices like
PLAs.
4. Cost:
o Lower manufacturing cost compared to more complex programmable devices.
Limitations of PAL:
1. Limited Flexibility:
o Since the OR plane is fixed, the range of logic functions that can be
implemented is constrained compared to PLAs.
2. Restricted Scalability:
o Suitable for simpler designs; complex logic may require multiple PALs or
other devices like FPGAs.
3. Non-Reprogrammable:
o Once programmed, PALs cannot be reprogrammed, making them less
versatile than modern reprogrammable devices.
Complex Programmable Logic Devices (CPLDs)
Definition:
A Complex Programmable Logic Device (CPLD) is an advanced programmable logic
device that combines the simplicity of PALs (Programmable Array Logic) with the flexibility
of FPGAs (Field Programmable Gate Arrays). CPLDs are used to implement complex digital
logic functions and are well-suited for applications requiring moderate levels of logic and fast
response times.
Structure of a CPLD:
1. Logic Blocks:
o A CPLD consists of several logic blocks, which are the basic units for
implementing logic functions.
o Each block contains a programmable AND-OR array (similar to PALs) and
optional flip-flops for sequential logic.
2. Programmable Interconnects:
o Logic blocks are connected through a programmable interconnect matrix,
which allows signals to flow between blocks as per the design.
3. I/O Blocks:
o CPLDs have input/output (I/O) pins for interfacing with external devices.
Each I/O pin is programmable for specific functions, such as input, output, or
bidirectional signals.
4. Non-Volatile Configuration Memory:
o Unlike FPGAs, CPLDs are non-volatile, meaning they retain their
configuration even after power is turned off.
Working of a CPLD:
1. Design Entry:
o The desired logic functions are written using a hardware description language
(HDL) like VHDL or Verilog, or through graphical tools.
2. Synthesis and Mapping:
o The design is compiled, and the logic is mapped onto the CPLD’s logic
blocks.
3. Programming:
o The CPLD is programmed using specialized tools (like JTAG) to configure
the AND-OR arrays and interconnects according to the design.
4. Execution:
o Once programmed, the CPLD executes the desired logic functions at high
speeds.
Features of CPLDs:
1. Non-Volatile Memory:
o CPLDs retain their configuration even when power is turned off, unlike
FPGAs.
2. High Speed:
o With simple and predictable routing, CPLDs provide fast and deterministic
timing.
3. Moderate Logic Density:
o CPLDs can implement designs with a moderate number of logic gates,
typically ranging from a few hundred to a few thousand.
4. Scalability:
o Designs can include both combinational and sequential logic, supporting more
complex circuits than PALs.
5. Low Power Consumption:
o CPLDs are energy-efficient, making them suitable for battery-powered
devices.
Applications of CPLDs:
1. Glue Logic:
o Used to connect and manage communication between different subsystems in
electronic devices.
2. Control Systems:
o Employed in industrial and consumer electronics for control logic.
3. I/O Expansion:
o To expand input/output capabilities in microcontroller-based systems.
4. Prototyping:
o For developing and testing digital circuits before moving to fixed hardware
implementations.
5. Embedded Systems:
o Commonly used in systems requiring moderate logic complexity with fast
response times.
Advantages of CPLDs:
1. Non-Volatile:
o Retains its configuration without requiring reprogramming at startup.
2. Fast and Deterministic Timing:
o Predictable delays due to simple interconnect structures.
3. Easy to Use:
o Simple architecture compared to FPGAs, making it easier for designers to
implement and debug logic.
4. Reliable:
o Robust performance in harsh environments, making them suitable for
industrial applications.
5. Cost-Effective:
o Less expensive than FPGAs for applications with moderate complexity.
Limitations of CPLDs:
The CPLD efficiently manages the control logic, ensuring a reliable and fast response to real-
time inputs, making it ideal for this type of application.
Definition:
A Field Programmable Gate Array (FPGA) is a highly flexible, reprogrammable
integrated circuit that allows designers to implement complex digital logic circuits. Unlike
fixed-function chips, FPGAs can be configured to perform any desired logic function, making
them ideal for a wide range of applications.
Structure of an FPGA:
Working of an FPGA:
1. Design Entry:
o The desired functionality is designed using a hardware description language
(HDL) like Verilog or VHDL, or with schematic tools.
2. Synthesis and Implementation:
o The design is synthesized into a gate-level representation, mapped onto the
FPGA's resources, and optimized for timing and area.
3. Programming the FPGA:
o The design is converted into a configuration bitstream, which is loaded into
the FPGA's configuration memory.
4. Execution:
o The FPGA executes the desired logic functions in real-time, based on the
programmed configuration.
Features of FPGAs:
1. Reprogrammable:
o FPGAs can be reconfigured multiple times, making them versatile for
prototyping and iterative design.
2. Massive Parallelism:
o FPGAs can execute multiple operations in parallel, unlike processors that
perform tasks sequentially.
3. High Flexibility:
o Designers can implement a wide variety of functions, from simple logic gates
to entire systems on a chip (SoC).
4. Deterministic Timing:
o FPGAs provide predictable timing, which is crucial for real-time applications.
Applications of FPGAs:
1. Prototyping:
o Used to test and validate designs before creating fixed-function ASICs.
2. Embedded Systems:
o Employed in applications requiring custom hardware acceleration, such as
robotics and IoT.
3. Digital Signal Processing (DSP):
o Ideal for high-speed data processing tasks like image processing, audio
processing, and wireless communication.
4. Data Centers:
oAccelerate workloads like machine learning, big data analytics, and network
processing.
5. Aerospace and Defense:
o Used in applications requiring high reliability and reconfigurability, such as
radar systems and secure communications.
6. Automotive:
o Power advanced driver-assistance systems (ADAS) and autonomous vehicle
functions.
Advantages of FPGAs:
1. Reconfigurability:
o Designs can be modified without changing the hardware.
2. High Performance:
o Parallel processing capabilities enable faster execution of complex algorithms.
3. Time to Market:
o Faster development cycles compared to fixed-function chips.
4. Customization:
o Supports the implementation of application-specific architectures.
5. Scalability:
o Can accommodate designs ranging from simple to highly complex systems.
Limitations of FPGAs:
1. Cost:
oHigher unit cost compared to ASICs for high-volume production.
2. Power Consumption:
o FPGAs typically consume more power than fixed-function chips.
3. Complexity:
o Requires specialized skills and tools to design and implement functionality.
4. Size:
o Larger and less area-efficient than custom-designed chips.
FPGAs are used in drones for real-time image processing to detect obstacles, recognize
objects, and stabilize flight. The parallel processing capability of FPGAs enables fast image
analysis, which is critical for autonomous navigation.
CPLDs are smaller devices with a limited amount of logic resources, typically used for simpler
tasks like controlling logic, glue logic, or simple state machines.
FPGAs are more powerful, offering a huge amount of programmable logic blocks and
memory, ideal for complex applications like signal processing, high-speed communications,
or even soft processors.
1. Specification
o Define what the circuit should do. This could be anything from simple logic
operations to more complex functions like a data processor.
2. Design Entry
o You describe the logic design using Hardware Description Languages (HDLs) like
VHDL or Verilog. This is how you define the behavior and structure of the circuit.
3. Synthesis
o This step converts your HDL code into a netlist, which is a representation of your
design in terms of basic logic gates.
4. Place and Route
o The netlist is mapped to the actual hardware resources inside the CPLD or FPGA. In
FPGAs, this means deciding which logic blocks to use, how to connect them, and
where to place them on the chip.
5. Programming
o Once the design is ready, it is programmed (downloaded) onto the CPLD or FPGA.
For CPLDs, this is a one-time programming (in many cases), while FPGAs are
reprogrammable.
6. Testing and Verification
o The final step is to test the design to ensure that it works as expected. Simulations
are usually done before programming to verify functionality.
Applications
CPLDs: Simple controllers, I/O expanders, glue logic in systems where low power and size are
important.
FPGAs: Data processing, video/image processing, high-speed communications, prototyping
of large digital systems.
In essence, CPLDs are better suited for simpler, more fixed-function logic, while FPGAs
excel in more complex, flexible applications where high performance is needed.
COMPUTER MODEL
Explain the basic building blocks of Computer model.
The basic building blocks of a computer model represent the core components that allow a
computer system to perform its functions. These blocks interact to process, store, and communicate
information effectively.
1. Input Unit
Function: Captures data and instructions from the user or external devices.
Examples:
o Keyboard
o Mouse
o Scanner
o Microphone
o Sensors
Process: Converts user inputs into a digital format understandable by the computer.
The CPU is the "brain" of the computer, where all processing takes place. It consists of the following
sub-components:
Function: Performs arithmetic (e.g., addition, subtraction) and logical operations (e.g., AND,
OR, NOT).
Role: Handles all mathematical computations and decision-making processes.
Function: Directs the flow of data and instructions between other components.
Role:
o Fetches instructions from memory.
o Decodes instructions to understand actions required.
o Executes instructions by coordinating with ALU and other parts.
c. Registers:
Function: Temporary storage inside the CPU for instructions, data, or intermediate results.
3. Memory Unit
Stores data and instructions for processing. It has two main types:
c. Cache Memory:
Function: A small, fast memory located close to the CPU to store frequently accessed data.
Role: Speeds up data retrieval and reduces latency.
4. Output Unit
5. Storage Unit
6. System Bus
Function: Facilitates communication between the CPU, memory, and I/O devices.
Types:
o Data Bus: Transfers actual data.
o Address Bus: Transfers memory or device addresses.
o Control Bus: Carries control signals (e.g., read/write operations).
7. Input/Output Devices
8. Communication System
Processor Model
The processor is the brain of a computer, responsible for executing instructions and
performing computations. It consists of several key components:
Directs the operation of the processor by decoding instructions and generating control
signals.
Coordinates the flow of data between the processor, memory, and I/O devices.
3. Registers:
Small, fast storage locations within the CPU.
Types of registers:
o Accumulator: Stores intermediate results of calculations.
o Program Counter (PC): Holds the address of the next instruction to be
executed.
o Instruction Register (IR): Holds the current instruction being executed.
o General-Purpose Registers: Used for temporary storage during
computations.
4. Clock:
5. Pipeline:
Memory Model
1. Hierarchy of Memory:
2. Memory Addressing:
3. Memory Operations:
1. Fetch-Execute Cycle:
o The processor fetches instructions from memory, decodes them, and executes
them.
o Steps:
1. Fetch: The program counter provides the address of the next
instruction to fetch.
2. Decode: The control unit interprets the instruction.
3. Execute: The ALU performs operations, or data is moved between
memory and registers.
2. Memory Bus:
o Address Bus: Specifies the memory address.
o Data Bus: Transfers data between processor and memory.
o Control Bus: Sends control signals (e.g., read/write).
Applications
Definition: RTL is a design abstraction used to describe the operations, data flow, and control
flow in a digital circuit. It specifies how data moves between registers and how operations are
performed using combinational logic.
Key Elements:
o Registers: Store data.
o Combinational Logic: Implements arithmetic, logical, and control functions.
o Control Signals: Dictate when and how data is transferred or processed.
The data path is a crucial part of a computer's central processing unit (CPU) and defines the
route that data follows through the system. It consists of various components that are
responsible for processing instructions and moving data between the CPU and memory. The
data path essentially handles the actual computation within the processor.
1. Registers
o Small storage locations inside the CPU that hold data temporarily during processing.
o Common registers include:
Program Counter (PC): Holds the address of the next instruction.
Accumulator: Stores the result of arithmetic and logic operations.
General-purpose Registers: Store operands and intermediate results.
2. Arithmetic Logic Unit (ALU)
o The ALU is the core part of the data path that performs all arithmetic (addition,
subtraction, etc.) and logic (AND, OR, NOT, etc.) operations.
o It takes inputs from registers, processes them according to the operation specified
by the instruction, and outputs the result back to the registers.
3. Multiplexers (MUX)
o Multiplexers are used to select between different data inputs. For example, a MUX
might select whether the data fed into the ALU comes from one register or another.
o They ensure that the correct data moves through the data path depending on the
instruction being executed.
4. Memory Access
o The data path interacts with both main memory (RAM) and cache memory to fetch
data or store results.
o The CPU accesses memory through the load and store instructions, where it
retrieves data from memory or writes data to it.
5. Instruction Decoder
o This component decodes the instruction fetched from memory and determines what
actions need to be taken.
o It tells the data path which operation to perform, which registers to use, and
whether to fetch or store data in memory.
6. Control Signals
o Control signals direct the flow of data within the data path, specifying which
registers to use, which operation the ALU should perform, and how to route the
data.
7. Buses
o Buses are the pathways that carry data, instructions, and control signals between
components.
o There are usually multiple buses:
Data bus: Transfers actual data.
Address bus: Specifies the memory locations of data.
Control bus: Carries control signals that manage data flow and operations.
Fetch: The CPU fetches an instruction from memory. The address of the next
instruction is stored in the Program Counter (PC).
Decode: The instruction is decoded to determine what operation is required (e.g.,
ALU operation, load/store operation).
Execute: The ALU or other functional unit performs the operation, using data from
registers, and places the result back into a register.
Memory Access: If the instruction involves reading or writing data to memory, the
data path will either fetch data from memory or store the result in memory.
Write-back: The result of the operation is written back to a register, and the process
repeats for the next instruction.
Simplified Example
Let’s say the CPU needs to execute an addition operation (ADD R1, R2, R3 which adds the
values in registers R2 and R3, and stores the result in R1):
Summary
The data path is the core mechanism that allows the CPU to process instructions and move
data. It consists of registers, the ALU, multiplexers, memory access units, and buses, all
coordinated by control signals to fetch, decode, execute, and write back data.
Control Part
The control part of a CPU, also known as the control unit (CU), is responsible for directing
the operations of the processor. It ensures that all components of the CPU work together in
harmony by generating control signals that manage the flow of data through the data path.
Essentially, the control unit tells the CPU what to do at every clock cycle, dictating which
operations should be performed and in what order.
1. Instruction Fetching
o The control unit fetches instructions from memory by generating the
appropriate signals. It retrieves the instruction stored at the address in the
Program Counter (PC), which holds the location of the next instruction.
2. Instruction Decoding
o After fetching the instruction, the control unit decodes it to understand what
operation needs to be performed. This decoding process involves interpreting
the opcode (the part of the instruction that specifies the operation) and
identifying the data or registers involved.
3. Control Signal Generation
o Based on the decoded instruction, the control unit generates control signals
that direct the various components of the data path. These signals tell:
Which operation the ALU should perform (e.g., addition, subtraction).
Which registers should be used for inputs and where to store the result.
Whether to fetch data from memory or store data into memory.
When to increment the Program Counter to fetch the next instruction.
4. Synchronization
o The control unit ensures that all operations are synchronized with the clock
signal. Each operation (fetch, decode, execute, etc.) is completed within a
clock cycle, and the control unit coordinates the timing of these actions to
prevent errors.
5. Control Flow (Branching and Jumping)
o The control unit handles branch and jump instructions, which alter the normal
sequential flow of execution. For instance, if an instruction tells the CPU to
jump to another location in memory (like in a function call or a loop), the
control unit updates the Program Counter accordingly.
There are two primary types of control units based on how they are implemented:
The control unit governs the steps of the instruction cycle, which can be broken down into
the following stages:
1. Fetch:
o The control unit sends signals to the memory to fetch the next instruction
based on the address in the Program Counter (PC). The instruction is loaded
into the Instruction Register (IR).
2. Decode:
o Once the instruction is fetched, the control unit decodes it by interpreting the
opcode and figuring out which operands are required and what operations
need to be performed.
3. Execute:
oBased on the decoded instruction, the control unit sends the appropriate
control signals to the ALU, registers, and memory to perform the desired
operation (e.g., an arithmetic operation or a memory access).
4. Write-back:
o The control unit ensures that the result of the executed instruction is written
back to the appropriate register or memory location.
Let's break down how the control unit might handle a simple instruction like ADD R1, R2,
R3 (which adds the contents of registers R2 and R3 and stores the result in R1):
1. Fetch:
o The control unit generates a control signal to fetch the ADD instruction from
memory and loads it into the Instruction Register (IR).
2. Decode:
o The control unit decodes the instruction and determines that it’s an addition
operation. It identifies the source registers (R2, R3) and the destination
register (R1).
3. Execute:
o The control unit sends a signal to the ALU to perform the addition of the
values in R2 and R3.
4. Write-back:
o The control unit sends a control signal to store the result of the addition back
into register R1.
5. Next Instruction:
o The control unit increments the Program Counter to point to the next
instruction and repeats the cycle.
Summary
The control part or control unit is the brain of the CPU that manages and coordinates the
execution of instructions. It generates control signals to direct the data flow in the data path
and ensures that all operations are carried out in a synchronized and orderly fashion.
Depending on the implementation, it can be hardwired for speed or microprogrammed for
flexibility.
module simple_cpu (
input wire clk,
input wire rst,
input wire [7:0] instruction,
output reg [7:0] result
);
reg [3:0] opcode;
reg [3:0] operand1, operand2;
This code describes a simple CPU that can perform addition and subtraction based on an 8-bit
instruction.
CPU design and test involve creating, implementing, and validating the central processing unit's
architecture and functionality. The process ensures that the CPU meets performance, functionality,
and reliability requirements.
1. CPU Design
a. Specification
b. Architectural Design
c. Microarchitecture Design
d. RTL Implementation
Translate the design into a hardware description language (HDL) like Verilog or VHDL.
Define components at the register-transfer level (RTL).
e. Physical Design
2. CPU Testing
Testing verifies the correctness, performance, and reliability of the CPU. It is conducted in various
stages:
a. Functional Testing
b. Timing Analysis
c. Synthesis Testing
d. Manufacturing Test
e. Performance Testing
Measure the CPU's speed, throughput, and power efficiency under real workloads.
Tools: Benchmarking software and performance profilers.
f. Debugging
1. Define Requirements
Example: A 4-bit CPU with a simple instruction set (add, subtract, load, store).
2. Design RTL
3. Create Testbench
4. Simulate
5. Synthesize
Convert the RTL design to a gate-level netlist and check for synthesis issues.
6. Verify on FPGA
7. Fabrication Testing
Test the physical CPU after manufacturing using scan testing and BIST.
entity CPU_Testbench is
end CPU_Testbench;
-- Clock generation
clk_process: process
begin
clk <= '0';
wait for 10 ns;
clk <= '1';
wait for 10 ns;
end process;
-- Test sequence
test_process: process
begin
reset <= '1';
wait for 20 ns;
reset <= '0';
CPU Design: Involves specifying, implementing, and optimizing the architecture (control
unit, data path, memory).
CPU Testing: Validates correctness, performance, and robustness at various stages
(functional testing, synthesis, manufacturing).
Tools like VHDL/Verilog simulators and FPGAs are essential for design and testing
processes.