0% found this document useful (0 votes)
16 views

Vlsi Lab Report

Uploaded by

Elias Beyene
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Vlsi Lab Report

Uploaded by

Elias Beyene
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Adama Science and Technology University

Electrical engineering and Computing


Department of ElectronicsandCommunication
VLSI Lab Report
Name ID
1. Elias Beyene ugr/20525/12
2. Esayas Worku ugr/19614/12
3. Adimasu Edlu ugr/19823/12
4. Eyasu Dechasa ugr/19577/12
5. Elias Mulugeta ugr/19820/12

Submitted to: Mr. Avtar


Submission date: Jan 27,2024
Lab Report
4-bit Half Adder using ModelSim PE Student Edition 10.1
Introduction
The purpose of this laboratory experiment is to create and simulate a 4-bit half adder using ModelSim PE
Student Edition 10.1. The half adder, a crucial component in digital circuits, is designed to combine two
single-bit binary numbers, producing both the sum and carry outputs. By understanding the functionality
and behavior of the half adder, we can gain essential insights into the operation of complex digital
systems.

Design:

1. Half Adder:
o Inputs: A, B
o Outputs: SUM, CARRY

SUM= A ⊕ B
Input Output
A B CARRY=A . B
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1

Procedure:
1. Begin by launching ModelSim PE Student Edition 10.1 and initiating a new project.
2. Create a fresh VHDL source file dedicated to the 4-bit half adder and proceed to write the VHDL code
for the half adder module. The code should encompass the entity declaration, port mapping, and
architecture. The VHDL code for the half adder module is provided below:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;

ENTITY HALF_ADDER IS
PORT (A, B: IN STD_LOGIC_vector (3 downto 0);
SUM, CARRY: out STD_LOGIC_vector (3 downto 0));
END HALF_ADDER;

ARCHITECTURE DATAFLOW OF HALF_ADDER IS


BEGIN
SUM <= A XOR B;
CARRY <= A AND B;
END DATAFLOW;
3. Compile the VHDL code for the half adder module.
4. Launch the simulation and carefully analyze the waveform to ensure the accuracy and validity of the
design.
Results:
The simulation results demonstrate the functionality of the 4-bit half adder module. The waveform
accurately depicts the input combinations and their corresponding output values, including the sum and
carry signals. The half adder produces correct sum and carry outputs in accordance with the provided
input combinations.

Conclusion:
In this laboratory experiment, we were able to successfully design and simulate a 4-bit half adder using
ModelSim PE Student Edition 10.1. The behavior of the half adder module was thoroughly examined, and
it demonstrated reliable performance by producing the expected sum and carry outputs for the given input
combinations. The half adder module serves as a fundamental building block in the realm of arithmetic
and logic circuits, and its successful operation reinforces its importance in various digital systems.

4-bit Full Adder using ModelSim PE Student Edition 10.1

Introduction:

The aim of this laboratory experiment is to design and simulate a 4-bit full adder using ModelSim PE
Student Edition 10.1. The full adder is an essential component in digital circuits, responsible for adding
three single-bit binary numbers: two inputs and a carry-in. Its main function is to generate both the sum
and carry outputs based on the given inputs. By studying and simulating the behavior of the full adder, we
can gain valuable insights into the functioning of complex digital systems.

Design:

1. Full Adder:
o Inputs: A, B, CIN
o Outputs: SUM, CARRY
A B CIN COUT= (A . B) + ( CIN . (A ⊕ B )) Sum= A ⊕B ⊕ CIN
Input Output

0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1

Procedure:
1. Begin by launching ModelSim PE Student Edition 10.1 and creating a new project.
2. Create a fresh VHDL source file dedicated to the 4-bit full adder and proceed to write the VHDL code
for the full adder module. Make sure to include the entity declaration, port mapping, and architecture. The
VHDL code for the full adder module is provided below:

LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;

ENTITY FULL_ADDER IS
PORT (A, B, C: IN STD_LOGIC_vector(3 downto 0);
SUM, CARRY: out STD_LOGIC_vector(3 downto 0));
END FULL_ADDER;

ARCHITECTURE DATAFLOW OF FULL_ADDER IS


BEGIN
SUM <= A XOR B XOR C;
CARRY <= ((A AND B) OR (B AND C) OR (C AND D));
END DATAFLOW;
3. Compile the VHDL code for the full adder module.
4. Launch the simulation and carefully analyze the waveform to ensure the accuracy and validity of the
design.
5. Declare signals for the inputs and observe the output to verify the results. Conduct thorough result
verification by comparing the generated output with the expected output for various input combinations.

Results
The simulation results demonstrate the functionality of the 4-bit full adder module. The waveform clearly
illustrates the input combinations and their corresponding output values, including the sum and carry
signals. The full adder consistently generates accurate sum and carry outputs in accordance with the
provided input combinations. This confirms the proper operation and adherence to expected behavior of
the full adder module in performing arithmetic operations.
Conclusion
In this laboratory experiment, the successful design and simulation of a 4-bit full adder using ModelSim
PE Student Edition 10.1 were accomplished. The impeccable behavior exhibited by the full adder module,
coupled with its reliable production of the expected sum and carry outputs in response to the given input
combinations, affirm its significance as a crucial building block in the realm of intricate arithmetic and
logic circuits.

4-bit Half Substractor using ModelSim PE Student Edition 10.1


Introduction
The purpose of this laboratory experiment is to create and simulate a 4-bit half substractor using
ModelSim PE Student Edition 10.1. The half subtractor is a fundamental digital circuit used in binary
subtraction. It takes two input bits, minuend (A) and subtrahend (B), and produces two output bits: the
difference (D) and the borrow (Bout). In a 4-bit half subtractor, these operations are extended to operate
on four-bit binary numbers, allowing for subtraction of larger binary numbers., we can gain essential
insights into the operation of complex digital systems.

Design

1. Half Substractor:
o Inputs: A, B
o Outputs: D, Bo

Procedure:
1. Project Initialization:
 Launch ModelSim PE Student Edition 10.1 and create a new project.
 Name the project appropriately, ensuring it reflects the purpose of simulating a 4-bit half
subtractor.
2. VHDL Source File Creation:
 Create a new VHDL source file specifically for the 4-bit half subtractor.
 Begin by defining the entity for the half subtractor, including the input ports (A[3:0],
B[3:0]) and output ports (Difference[3:0], BorrowOut).
 Proceed to write the VHDL code for the architecture, implementing the logic for the half
subtractor.
3. VHDL Code for Half Subtractor:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;

ENTITY HALF_SUBTRACTOR IS
PORT (A, B: IN STD_LOGIC_VECTOR (3 DOWNTO 0);
DIFFERENCE, BORROWOUT: OUT STD_LOGIC_VECTOR (3 DOWNTO 0));
END ENTITY HALF_SUBTRACTOR;

ARCHITECTURE DATAFLOW OF HALF_SUBTRACTOR IS


BEGIN
DIFFERENCE <= A XOR B;
BORROWOUT <= (NOT A AND B) OR (A = B);
END ARCHITECTURE DATAFLOW;
4. Compile VHDL Code:
 Compile the VHDL code for the 4-bit half subtractor module to check for syntax errors or
any other issues.
5. Simulation Setup:
 Launch the ModelSim simulation environment.
 Load the compiled design files into the simulation workspace.
6. Testbench Creation:
 Develop a testbench module in VHDL to stimulate the inputs of the half subtractor and
monitor the outputs.
 Ensure the testbench provides sufficient test cases to cover various input scenarios,
including edge cases.
7. Simulate the Design:
 Run the simulation by executing the testbench module.
 Monitor the simulation waveform to observe the behavior of the half subtractor outputs
(Difference and BorrowOut) for different input combinations.

Results:
During simulation in ModelSim PE Student Edition 10.1, the 4-bit half subtractor exhibited correct
functionality. The waveform analysis confirmed accurate computation of the difference (D) between the
minuend (A) and subtrahend (B) inputs, as well as the generation of the borrow (BorrowOut) signal when
necessary. This indicates that the subtraction process adhered to binary arithmetic rules, producing
expected results for various input combinations.
Conclusion:
The simulation successfully validated the VHDL implementation of the 4-bit half subtractor. It
demonstrated reliable performance in computing differences and handling borrow operations, confirming
its suitability for digital logic circuits requiring subtraction functionality. This exercise underscores the
importance of simulation for verifying and validating digital designs before implementation, ensuring
correctness and reliability in practical applications.
4-bit Full Adder using ModelSim PE Student Edition 10.1
Introduction:
Digital circuits form the backbone of modern computing systems, enabling the manipulation and
processing of binary data through various logical operations. One fundamental operation in digital
arithmetic is subtraction, which is essential for tasks ranging from simple arithmetic calculations to
complex data processing algorithms. The half subtractor is a fundamental building block in digital
circuitry, specifically designed to perform binary subtraction of two bits. In this lab experiment, we aim to
design, simulate, and analyze a 4-bit half subtractor using Modelling PE Student Edition 10.1 software.

Design:

1. Full Substractor:
o Inputs: A, B, BorrowIN
o Outputs: Diff, Borrow

Procedure:

1. Project Initialization:
 Open ModelSim PE Student Edition 10.1 and create a new project to begin.
Name the project appropriately, reflecting the purpose of simulating a 4-bit full
subtractor.
2. VHDL Source File Creation:
 Create a new VHDL source file dedicated to the 4-bit full subtractor.
 Write the VHDL code for the full subtractor module, including the entity declaration, port
mapping, and architecture.
3. VHDL Code for Full Subtractor:

LIBRARY IEEE;

USE IEEE.STD_LOGIC_1164.ALL;

ENTITY FULL_SUBTRACTOR IS

PORT (A, B, BorrowIn: IN STD_LOGIC_VECTOR (3 DOWNTO 0);

Difference, BorrowOut: OUT STD_LOGIC_VECTOR (3 DOWNTO 0));

END ENTITY FULL_SUBTRACTOR;

ARCHITECTURE DATAFLOW OF FULL_SUBTRACTOR IS

BEGIN

Difference <= (A XOR B) XOR BorrowIn;

BorrowOut <= ((NOT A) AND B) OR (((NOT A) OR B) AND BorrowIn);

END ARCHITECTURE DATAFLOW;

4. Compile VHDL Code:


 Compile the VHDL code for the 4-bit full subtractor module to check for syntax errors
and ensure correctness.
5. Simulation Setup:
 Launch ModelSim and load the compiled design files into the simulation workspace.
6. Testbench Creation (Optional):
 Optionally, develop a testbench module in VHDL to stimulate the inputs of the full
subtractor and monitor the outputs.
 The testbench should include various test cases covering different input combinations.
7. Simulate the Design:
 Run the simulation by executing the testbench module if created, or directly simulate the
full subtractor module.
 Carefully analyze the waveform to verify the accuracy and validity of the design.
Results:

Simulation of the 4-bit half subtractor using Modelling PE Student Edition 10.1 yielded accurate and
expected outcomes. The waveform analysis confirmed correct computation of the difference between the
4-bit binary numbers provided as inputs (A and B). Additionally, the borrow output was generated
appropriately when required, ensuring adherence to binary arithmetic rules for subtraction.

Conclusion:

The simulation of the 4-bit half subtractor demonstrated its functionality and suitability for digital
subtraction operations. Through the use of basic digital logic components and Modelling PE Student
Edition 10.1, we successfully designed and simulated a fundamental building block of digital arithmetic.
This experiment provided valuable insights into binary subtraction principles and practical experience in
digital circuit design and simulation. Overall, the lab exercise served as an effective learning opportunity,
reinforcing theoretical concepts and preparing students for more advanced topics in digital systems and
computer engineering.

4 to 1 Demultiplexer (DMUX) using ModelSim PE Student Edition 10.1

Introduction:
The primary goal of this lab experiment is to conceptualize and simulate a 4 to 1 Demultiplexer (DMUX)
using ModelSim PE Student Edition 10.1. A Demultiplexer is a crucial combinational circuit that receives
a single input and directs it to one of the multiple output lines based on the control signals provided. In
this experiment, our focus is on designing a 4 to 1 DMUX, which specifically takes a 2-bit select signal
and effectively routes the input to one of the four output lines based on the specific select signal
combination. By understanding the functionality and behavior of the DMUX, we can gain essential
insights into the operation of complex digital systems.

Design
1. 4 to 1 Demultiplexer (DMUX):

o Inputs: A (Input), S1, S0 (Select signals)


o Outputs: A, B, C, D (Output lines)
1. F Input Output
S0 S1 A B C D
1 0 0 1 0 0 0
1 0 1 0 1 0 0
1 1 0 0 0 1 0
1 1 1 0 0 0 1

Truth table of 4:1 DMUX

Schematic diagram of 4:1 DMUX

Procedure:

1. Begin by launching ModelSim PE Student Edition 10.1 and creating a new project.
2. Create a new VHDL source file dedicated to the 4 to 1 Demultiplexer (DMUX) and proceed to
write the VHDL code for the DMUX module. Make sure to include the entity declaration, port
mapping, and architecture. The VHDL code for the DMUX module is provided below:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity DMUX is
Port (F: in STD_LOGIC_VECTOR(3 DOWNTO 0);
S1, S0: in STD_LOGIC;
A, B, C, D: out STD_LOGIC_VECTOR(3 DOWNTO 0));
end DMUX
architecture Behavioral of DMUX is
begin
process(S1, S0, F)
begin
if (S0 ='0' and S1 = '0')
then
A <= F;
elsif (S0 ='1' and S1 = '0')
then
B <= F;
elsif (S0 ='0' and S1 = '1')
then
C <= F;
else
D <= F;
end if;
end process;
end Behavioral;

3. Compile the VHDL code for the DMUX module.


4. Run the simulation and observe the waveform to verify the correctness of the design.
Results
The simulation results indicate the successful operation of the 4 to 1 Demultiplexer (DMUX) module. The
waveform clearly illustrates the input combinations (F, S1, S0) and their corresponding output values (A,
B, C, D). The DMUX consistently routes the input to the correct output line based on the select signals,
demonstrating its reliable and precise functionality in demultiplexing the input signal. These findings
contribute to a comprehensive understanding of the DMUX module's behavior and its suitability for
implementing data routing and signal demultiplexing in digital systems.

Conclusion
In this laboratory experiment, we successfully designed and simulated a 4 to 1 Demultiplexer (DMUX)
using ModelSim PE Student Edition 10.1. The DMUX module demonstrated impeccable behavior by
accurately routing the input to the desired output line, precisely following the select signals' instructions.
This circuit serves as a valuable tool for data routing and signal demultiplexing in a wide range of digital
systems. The successful implementation and evaluation of the DMUX module contribute to our
understanding of its reliable functionality and its applicability in practical digital design scenarios.

2:4 decoder using ModelSim PE Student Edition 10.1

Introduction

A decoder is a combinational circuit that converts binary information from n input lines to a
maximum of 2^n unique output lines. VHDL (Very High-Speed Integrated Circuit Hardware
Description Language) is commonly used as a hardware description language for implementing
digital electronics. VHDL provides a standardized and efficient way to describe the behavior and
structure of the decoder circuit. In this experiment, we have chosen a toolkit that allows for
simulation and synthesis of VHDL code, making it suitable for designing and analyzing decoder
circuits.
Design:

Procedure:
1. Project Initialization:
 Launch ModelSim PE Student Edition 10.1 and create a new project.
 Name the project appropriately to reflect the simulation of a 2-to-4 decoder.
2. VHDL Source File Creation:
 Create a new VHDL source file dedicated to the 2-to-4 decoder.
 Write the VHDL code for the decoder module, including the entity declaration,
port mapping, and architecture.
3. VHDL Code for 2-to-4 Decoder:

VHDL Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Decoder is
port (A : in STD_LOGIC_VECTOR(1 downto 0); E : in STD_LOGIC;D : out
STD_LOGIC_VECTOR (3 downto 0));
end Decoder;
architecture behavioral of Decoder is
begin
process (A)
begin
if(E = '1')
then
case A is
when "00"=> D<="0001";
when "01"=> D<="0010";
when "10"=> D<="0100";
when "11"=> D<="1000";
end case;
end if;
end process;
end behavioral;

4. Compile VHDL Code:


 Compile the VHDL code for the 2-to-4 decoder module to check for syntax errors
and ensure correctness.
5. Simulation Setup:
 Launch ModelSim and load the compiled design files into the simulation
workspace.
6. Testbench Creation (Optional):
 Optionally, develop a testbench module in VHDL to stimulate the inputs of the
decoder and monitor the outputs.
 The testbench should include various test cases covering different input
combinations.
7. Simulate the Design:
 Run the simulation by executing the testbench module if created, or directly
simulate the decoder module.
 Carefully analyze the waveform to verify the accuracy and validity of the design.
Result
The VHDL code for a 2-4 decoder circuit was successfully written and implemented in this lab
experiment using ModelSim PE Student Edition 10.4 software. VHDL, a hardware description
language, was utilized to accurately describe the behavior of the digital circuit.
The 2-4 decoder circuit consists of two input lines and four output lines. The input lines serve as
selectors for the output lines, determining which one will be activated based on the selected input
line.
To verify the correctness of the design, the waveform generated by the simulation was observed.
The waveform allowed for a thorough examination of the circuit's behavior, ensuring that it
operated as intended. Special attention was given to the output lines, confirming that the
appropriate line was activated based on the selected input line.

Conclusion
The VHDL code for the 2-4 decoder was successfully designed, implemented, and verified using
ModelSim PE Student Edition 10.4 software. The simulation results provided evidence of the
correct functionality of the implemented decoder, confirming that it operates as intended. This
lab experiment showcased the practical application of VHDL in designing and implementing a 2-
4 decoder, which is an essential component in digital systems.

You might also like