VLSI Manual Milan
VLSI Manual Milan
COMMUNICATION ENGINEERING
Semester: 5th
Division: B
Batch : B1
L.D. College of Engineering, Ahmedabad
CERTIFICATE
Date of Submission:
Place: L.D. College of Engineering, Ahmedabad.
10
11
12
13
14
15
16
17
Experiment: 1
1. PLD Devices
1.1 ROM :
ROM (Read-Only Memory) is a type of computer memory that stores data that cannot be easily
modified or overwritten by normal computer operations. It is a non-volatile memory, meaning its
contents are retained even when the computer is powered off. ROM is used to store essential system
firmware, software programs, and data that should remain unchanged over time.
1.2 PLA :
A PLA, or Programmable Logic Array, is a digital electronic device used in digital circuit design. It
is a type of programmable logic device that allows you to create custom digital logic circuits by
programming the connections between its inputs and outputs.
A PLA consists of an array of programmable AND gates followed by programmable OR gates. The
AND gates take input signals and determine whether they are active or not, and the OR gates
combine these signals to generate the final output.
PLAs are versatile devices that can be configured to implement a wide range of logic functions and
combinational logic circuits. They are commonly used in digital circuit design, prototyping, and
small-scale custom logic implementations. However, with the advancement of technology, more
complex and flexible programmable logic devices like FPGAs (Field-Programmable Gate Arrays)
have largely superseded PLAs in many applications.
1.3 PAL :
Programmable Array Logic (PAL) is a type of digital logic device used in electronics and computer
hardware design. It falls under the category of programmable logic devices (PLDs). PAL devices
are designed to implement specific logic functions by allowing users to program the device to
perform desired operations.
PAL devices consist of an array of programmable AND gates followed by OR gates. Here’s how
they work:
1. AND Array : The AND array is composed of multiple input lines and programmable AND
gates. Each AND gate can have multiple inputs, which are connected to various
combinations of input signals. These input signals could come from switches, other logic
gates, or external devices.
2. OR Array : The outputs of the programmable AND gates are fed into the OR array. The OR
array combines the outputs of the AND gates using programmable connections to generate
the final output signals.
The programming of a PAL device involves setting the connections within the AND and OR arrays
to create the desired logic function. This is typically done using a hardware description language
(HDL) or a schematic entry tool provided by the manufacturer. By configuring the connections and
inputs, you can create custom logic functions that suit your specific design requirements.
1.4 CPLD :
Complex Programmable Logic Device (CPLD) is a type of programmable logic device used in
digital circuit design. It provides a higher level of complexity and flexibility compared to simpler
devices like PALs (Programmable Array Logic).
CPLDs consist of multiple blocks of programmable logic, often referred to as "microcells" or "logic
blocks." Each block contains a combination of programmable AND & OR gates, as well as flip-
flops. These blocks can be interconnected and programmed to implement complex digital logic
functions.
1.5 FPGA :
A Field-Programmable Gate Array (FPGA) is a highly configurable and programmable integrated
circuit used in digital circuit design and electronic systems. Unlike fixed-function integrated
circuits, FPGAs allow users to define their own digital logic circuits and even create custom digital
hardware.
2. Introduction to HDL :
Hardware Description Language (HDL) is a specialized programming language used for designing
and describing digital logic circuits and systems. HDLs are essential tools for designing hardware at
various levels of abstraction, from simple digital gates to complex integrated circuits. They enable
engineers and designers to describe the behavior and structure of digital circuits in a human-
readable and machine-proccesable format.
Applications :
Due to its rigor and thoroughness, VHDL is commonly used in safety-critical and mission-
critical applications, such as aerospace and defense.
It is favored for projects where simulation and verification are crucial, as its explicit syntax
aids in catching potential errors.
Design Paradigm :
VHDL encourages a structured design approach, promoting the creation of reusable and
hierarchical modules.
Designers define entities (similar to modules) with input and output ports, and then describe
their behavior using processes, functions, and procedures.
4.2 Verilog :
Origin and Purpose :
Verilog was developed by Gateway Design Automation (acquired by Cadence Design
Systems) in the mid-1980s.
It aimed to simplify the process of designing and simulating digital circuits.
Applications :
Verilog is widely used in industry for a broad range of digital design projects, from small
circuits to complex systems-on-chip (SoCs).
It is popular in projects where ease of use, quick development, and flexibility are important.
Design Paradigm :
Verilog allows a mix of structural and behavioral modeling approaches. Designers can create
modules and describe behavior using procedural blocks.
Procedural blocks in Verilog, like “always” blocks, are used to describe how signals change
over time and model sequential logic.
4.3 Comparison :
VHDL emphasizes explicitness and precision, making it well-suited for safety-critical
applications and projects where verification is paramount.
Verilog offers a more flexible and intuitive approach to behavioral modeling, making it
popular for a wide range of design projects.
1. Xilinx :
FPGA Families : Xilinx offers several FPGA families, including Virtex, Kintex, Artix, and
Spartan. These families vary in terms of performance, logic capacity, and features.
Use Cases : Xilinx FPGAs are used in a wide range of applications, including data centers,
automotive, aerospace, telecommunications, and more.
Notable FPGA : Xilinx’s Versal ACAP (Adaptive Compute Acceleration Platform)
combines FPGA fabric with adaptable hardware engines and AI capabilities.
3. Lattice Semiconductor :
FPGA Families : Lattice offers FPGA families like ECP, MachXO, and iCE. These are
known for low-power consumption and are suitable for edge devices and small-scale
applications.
Use Cases : Lattice FPGAs are used in mobile devices, consumer electronics, IoT, and
industrial control systems.
Notable FPGA : Lattice’s CrossLink-NX FPGA family focuses on bridging and connectivity
solutions.
5. Achronix Semiconductor :
FPGA Families : Achronix offers FPGA families like Speedster and Speedcore. Speedster
FPGAs are known for high-performance processing, while Speedcore focuses on embedding
FPGA fabric into ASICs.
Use Cases : Achronix FPGAs are used in data centers, networking, machine learning, and
high-frequency trading.
Notable FPGA : Achronix’s Speedster7t FPGA family is designed for high-performance
compute and AI applications.
Types of FPGA:
1. High-Performance FPGAs :
Designed for applications that require extensive processing power, such as data centers,
scientific computing, and high-performance computing.
Feature large logic capacity, high-speed I/O interfaces, and specialized hardware for
accelerating complex computations.
2. Low-Power FPGAs :
Optimized for applications where power efficiency is crucial, such as portable devices, IoT
devices, and battery-powered systems.
Focus on reducing power consumption while maintaining reasonable performance and
functionality.
3. High-Capacity FPGAs :
Equipped with a significant number of logic cells, memory blocks, and I/O interfaces.
Ideal for applications demanding a large amount of logic and memory resources, such as
video processing, networking, and data storage.
4. Small-Form-Factor FPGAs :
Compact FPGAs suitable for space-constrained applications, including embedded systems,
sensor nodes, and edge devices.
Offer a balance between resource availability and physical size.
5. Mixed-Signal FPGAs :
Combine digital programmable logic with analog components, enabling integration of
digital and analog functionality on a single chip.
Used in applications like sensor interfaces, data conversion, and analog signal processing.
6. DSP FPGAs :
Optimized for digital signal processing tasks, including filtering, modulation, demodulation,
and audio processing.
Feature specialized DSP blocks and math functions for efficient signal processing.
8. Reconfigurable FPGAs :
Enable partial reconfiguration of specific portions of the FPGA while the rest of the design
remains operational.
Useful for systems that need to adapt to changing requirements or tasks.
9. SoC FPGAs :
Integrate FPGA fabric with embedded processors (such as ARM cores) and other system
components on a single chip.
Enable seamless integration of custom hardware acceleration with general-purpose
processing.
Introduction of gates:
1. AND gate:
Boolean Equation : Y = A ∙ B
Verilog Code:
endmodule
Output Waveform:
2. OR gate:
Boolean Equation: Y = A + B
Verilog Code:
endmodule
Output Waveform:
3. NOT gate:
Boolean Equation: Y = A
he output mayalculated using the Boolean equation Y=A’.
Input A Output Y
0 1
1 0
Verilog Code:
Output Waveform:
4. NOR gate:
Boolean Equation: Y = A+ B
Verilog Code:
endmodule
Output Waveform:
5. NAND gate:
Boolean Equation: Y = A ∙ B
Verilog Code:
endmodule
Output Waveform:
6. XOR gate:
Boolean Equation: Y = A Ꚛ B
Verilog Code:
1. Data Flow: 2. Structural 3. Behavioral
module xor_gate ( module xor_gate ( module xor_gate (
input wire in0,in1, input wire in0,in1, input wire in0,in1,
output wire out); output wire out); output reg [0:0]out);
endmodule
Output Waveform:
7. XNOR gate:
Boolean Equation: Y = A Ꙩ B
1. Half Adder:
Boolean Equation: S = A Ꚛ B
C=A∙B
Verilog Code:
2. full Adder :
. Boolean Equation: S = A Ꚛ B Ꚛ Cin
Cout = (A ∙ B) + Cin ∙ (A Ꚛ B)
Verilog Code:
endmodule
Behavioral:
module full_adder (
input wire [0:2]in,
output reg [0:0]s,
output reg [0:0]c_out);
always @ (in)
begin
if((in===3'b001) | (in===3'b001) | (in===3'b100))
begin
s<= 1;
c_out <=0;
end
else if((in===3'b011) | (in===3'b110) | (in===3'b101))
begin
s<= 0;
c_out <=1;
end
else
begin
s<= 1;
c_out <=1;
end
end
endmodule
Output Waveform:
3. Half Subtractor:
Boolean Equation: S = A Ꚛ B
C= A∙B
Output Waveform:
4. Full Subtractor :
Boolean Equation: S = A Ꚛ B Ꚛ Cin , Bout = (B ∙ Bin) + (A Ꙩ B)
Verilog code:
Output Waveform:
Experiment-4
Aim: Implementation of Multiplexer & Demultiplexer and its testing.
1. MUX 4x1:
Boolean Equation: = s1’s0’D + s1’s0D +
s1s0’D + s1s0D
S0 S1 Output
0 0 Ch0
0 1 Ch1
1 0 Ch2
1 1 Ch3
Verilog Code:
not (sw_not[0],sw[0]);
not (sw_not[1],sw[1]); S0 S1 S2 Output
and(tm[0],sw_not[0],sw_not[1],ch[0]); 0 0 0 I0
and(tm[1],sw[0],sw_not[1],ch[1]); 0 0 1 I1
and(tm[2],sw_not[0],sw[1],ch[2]); 0 1 0 I2
and(tm[3],sw[0],sw[1],ch[3]);
0 1 1 I3
or(d,tm[0],tm[1],tm[2],tm[3]);
1 0 0 I4
endmodule 1 0 1 I5
1 1 0 I6
1 1 1 I7
Data Flow:
module mux_8x1(
input wire [0:7]I,
input wire [0:2]S,
Output Waveform:
output Y);
assign Y = ((~S[0]) & (~S[1]) & (~S[2]) & (I[0])) | ((~S[0]) & (~S[1]) & (S[2]) &
(I[1])) | ((~S[0]) & (S[1]) & (~S[2]) & (I[2])) | ((~S[0]) & (S[1]) & (S[2]) & (I[3])) |
((S[0]) & (~S[1]) & (~S[2]) & (I[4])) | ((S[0]) & (~S[1]) & (S[2]) & (I[5])) | ((S[0]) &
(S[1]) & (~S[2]) & (I[6])) | ((S[0]) & (S[1]) & (S[2]) & (I[7]));
endmodule
2. MUX 8x1:
Boolean Equation: Y =S1’S1’S2’I0 + S1’S1’S2’I0 +
S1’S1’S2’I0 + S1’S1’S2’I0 + S1’S1’S2’I0 +
S1’S1’S2’I0 + S1’S1’S2’I0 + S1’S1’S2’I0
S0 S1 S2 Output
0 0 0 I0
0 0 1 I1
0 1 0 I2
0 1 1 I3
1 0 0 I4
1 0 1 I5
1 1 0 I6
1 1 1 I7
Verilog Code:
Structural: Behavioral:
module mux_8x1( module mux_8x1(
input wire [0:7]I, input wire [2:0]sw,
input wire [0:2]S, input wire [7:0]ch,
output wire [0:7]tm, output reg [0:0]d);
output wire [0:2]S_not, always @(sw)
output Y); begin
case(sw)
not(S_not[0],S[0]); 3'b000: d=ch[0];
not(S_not[1],S[1]); 3'b001: d=ch[1];
not(S_not[2],S[2]); 3'b010: d=ch[2];
3'b011: d=ch[3];
and(tm[0],S_not[0],S_not[1],S_not[2],I[0]); 3'b100: d=ch[4];
and(tm[1],S_not[0],S_not[1],S[2],I[1]); 3'b101: d=ch[5];
and(tm[2],S_not[0],S[1],S_not[2],I[2]); 3'b110: d=ch[6];
and(tm[3],S_not[0],S_not[1],S[2],I[3]); default :
and(tm[4],S[0],S_not[1],S_not[2],I[4]); d=ch[7];
and(tm[5],S[0],S_not[1],S[2],I[5]); endcase
and(tm[6],S[0],S[1],S_not[2],I[6]); end
and(tm[7],S[0],S[1],S[2],I[7]); endmodule
or(Y,tm[0],tm[1],tm[2],tm[3],tm[4],tm[5],tm[6],tm[7]);
endmodule
Output Waveform:
4. DEMUX 1x4:
Boolean Equation: Y0=S0’S1’D, Y0=S0S1’D, Y0=S0’S1D, Y0=S0S1D
Verilog Code:
not(sw_not[0],sw[0]);
not(sw_not[1],sw[1]);
and(out[0],sw_not[0],sw_not[1],d);
and(out[1],sw_not[0],sw[1],d);
and(out[2],sw[0],sw_not[1],d);
and(out[3],sw[0],sw[1],d);
endmodule
Output Waveform:
Experiment-5
Aim: Implementation of 3 to 8 Decoder & 8 to 3 encoder and its testing.
3 to 8 Decoder:
Boolean Equation: Y0=A0’A1’A2’, Y1=A0’A1’A2, Y2=A0’A1A2’, Y3=A0’A1A2,
Y4=A0A1’A2’, Y5=A0A1’A2, Y6=A0A1A2’, Y7=A0A1A2
A A A Y Y Y Y Y Y Y Y
0 1 2 0 1 2 3 4 5 6 7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
Verilog Code:
Structural: Behavioral:
module decode_3x8 ( module decode_3x8(
output wire [0:7]out, input wire [2:0]in,
input wire [0:2]in, output reg [7:0]out);
output wire [0:2]in_not);
always @(in)
not(in_not[0],in[0]); begin
not(in_not[1],in[1]); case(in)
not(in_not[2],in[2]); 3'b000: out=8'b00000001;
3'b001: out=8'b00000010;
and(out[0],in_not[0],in_not[1],in_not[2]); 3'b010: out=8'b00000100;
and(out[1],in_not[0],in_not[1],in[2]); 3'b011: out=8'b00001000;
and(out[2],in_not[0],in[1],in_not[2]); 3'b100: out=8'b00010000;
and(out[3],in_not[0],in[1],in[2]); 3'b101: out=8'b00100000;
and(out[4],in[0],in_not[1],in_not[2]); 3'b110: out=8'b01000000;
and(out[5],in[0],in_not[1],in[2]); default : out=8'b10000000;
and(out[6],in[0],in[1],in_not[2]); endcase
and(out[7],in[0],in[1],in[2]); end
endmodule
endmodule
Data Flow:
module decode_3x8 (
output wire [0:7]out,
input wire [0:2]in);
Output Waveform:
8 to 3 Encoder:
Boolean Equation: A0 = Y0 + Y1 + Y3 + Y5 + Y, A1 = Y2 + Y3 + Y6 + Y7 , A2 = Y4 + Y5 +
Y6 + Y
Y Y1 Y2 Y Y4 Y5 Y6 Y A0 A A2
0 3 7 1
1 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 1 0 0
0 0 0 0 0 1 0 0 1 0 1
0 0 0 0 0 0 1 0 1 1 0
0 0 0 0 0 0 0 1 1 1 1
Verilog Code:
Data Flow:
Behavioral:
module encode_8x3(
module encode_8x3(
input wire [0:7]in,
input wire [7:0]in,
output wire [0:2]out);
output reg [2:0]out);
assign out[0] = in[4] | in[5] | in[6] | in[7];
always @(in)
assign out[1] = in[2] | in[3] | in[6] | in[7];
begin
assign out[2] = in[1] | in[3] | in[5] | in[7];
case(in)
endmodule
8'b00000010: out=3'b001;
8'b00000100: out=3'b010;
8'b00001000: out=3'b011;
Structural:
8'b00010000: out=3'b100;
module encode_8x3(
8'b00100000: out=3'b101;
input wire [0:7]in,
8'b01000000: out=3'b110;
output wire [0:2]out);
8'b10000000: out=3'b111;
or(out[0],in[4],in[5],in[6],in[7]);
default : out=3'b000;
or(out[1],in[2],in[3],in[6],in[7]);
endcase
or(out[2],in[1],in[3],in[5],in[7]);
end
endmodule
endmodule
Output Waveform:
Experiment-6
JK Flip-Flop :
Boolean Equation: Q = J Q' + K' QQ' = J' Q + KQ'
CLK J K Q Q’
ʃ 0 0 Q Q’
ʃ 0 1 0 0
ʃ 1 0 0 1
ʃ 1 1 T T
Verilog Code:
module jk_ff(
input j,k,rst,pst,clk,
output reg q,q_bar);
always @ (posedge clk) begin
if(rst)
q<=0;
else if (pst)
q<=1;
else begin
if(!j &&!k)
q<=q;
else if (j && !k)
q<=1;
else if (!j && k)
q<=0;
else
q<=~q;
end
q_bar <=~q;
end
endmodule
Output Waveform:
D Flip-Flop :
Boolean Equation: Q = D , Q' = D'
CL
D Q Q’
K
ʃ 0 0 1
ʃ 1 1 0
Verilog Code:
module d_ff(
input d,rst,pst,clk,
output reg q,q_bar);
Output Waveform:
T Flip-Flop :
Boolean Equation: Q = (T Q'(t)) + (T'Q(t))
CL
T Q Q’
K
ʃ 0 0 0
ʃ 1 1 1
Verilog Code:
module t_ff(
input t,rst,pst,clk,
output reg q,q_bar);
Output Waveform:
Experiment-7
Aim: Implementation of sequential adder and its testing
4 Bit Adder:
Binary adders are implemented to add two binary numbers. So in order to
add two 4 bit binary numbers, we will need to use 4 full-adders. The
connection of full-adders to create binary adder circuit is discussed
in block diagram below.
assign Sum = A + B;
assign CarryOut = (A[3] & B[3]) | (A[2] & B[2]) | (A[1] & B[1]) | (A[0]
& B[0]);
endmodule
Out
Experiment-8
Aim: Implementation of BCD Counter and its testing.
BCD Counter:
Verilog Code:
CL
module bcd_counter ( Reset Count
input wire clk,rst, K
output reg [0:3]count); ʃ 0 0 0 0 0
ʃ 0 0 0 0 1
always @(posedge clk) begin ʃ 0 0 0 1 0
if (rst ===1) begin
count<=0; ʃ 0 0 0 1 1
end
ʃ 0 0 1 0 0
else begin ʃ 0 0 1 0 1
if (count ===4'b1001) begin
count <= 0; ʃ 0 0 1 1 0
end
ʃ 0 0 1 1 1
else begin
count <= count + 1'b1; ʃ 0 1 0 0 0
end
end ʃ 0 1 0 0 1
end ʃ 0 0 0 0 0
endmodule
RTL Viewer:
Output Waveform:
Experiment-9
Aim: Implementation of two 8-bit multiplier and its testing.
8-Bit Multiplier:
Verilog Code:
module multiplier_8bit(
input wire [0:7]a,
input wire [0:7]b,
output wire [0:15]result);
endmodule
RTL Viewer:
Output Waveform:
Experiment-10
Aim: Simulation and verification of two input CMOS NOR gate using
SPICE.
PROGRAM:
CMOS nor
vpower vdd 0 1.8v
vgnd vss 0 0
* element description
M1 Vout Vin1 vss 0 CMOSN w=5u l=.18u
M2 3 Vin2 vdd vdd CMOSP w=2.5u l=.18u
M3 Vout Vin2 vss 0 CMOSN w=5u l=.18u
M4 Vout Vin1 3 vdd CMOSP w=2.5u l=.18u
CL Vout vss 0.1p
*voltage supply
*VDD 3 0 2v
Vpul1 Vin1 0 pulse(0 1.8 10n 1n 1n 20n 60n)
Vpul2 Vin2 0 pulse(0 1.8 0n 1n 1n 15n 60n)
*model files
.include modelcard.pmos
.include modelcard.nmos
*analysis type
.tran 0 40n 1n
*output performance
.control
run
set color0= white
set xbrushwidth = 2
plot Vout Vin1 Vin2
.endc
Experiment-11
PROGRAMl:
*CMOS inverter
* element description
M1 2 1 0 0 CMOSN w=5u l=.18u
M2 2 1 3 3 CMOSP w=2.5u l=.18u
CL 2 0 0.1p
*voltage supply
VDD 3 0 2v
Vpul 1 0 pulse(0 2 0n 1n 1n 10n 20n)
*model files
.include modelcard.pmos
.include modelcard.nmos
*analysis type
.dc vpul 0 2 .1
.tran 1 40n 1n
* output performance
.control run
plot v(2) v(1)
.endc