ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCC-110Hdl Lab Assignments
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    CC-110

    Digital Logic Design

    Progress0 / 63 done
    Topics63
    1Introduction to Digital Systems2Number Systems3Introduction to Boolean Algebra4Basic theorems and properties of Boolean Algebra5Boolean Functions6Logic Gates7NAND and NOR Implementation8Representation of Function in Sum of Minterms or Product of Maxterms9Simplification of Boolean function using Karnaugh Map10Don't care Conditions11The Tabulation Method12Introduction to Combinational Logic13Design of Adders14Design of Subtractors15Code Convertors16Analysis Procedure of Combinational Circuits17Binary Parallel Adders18Decimal Adders19Magnitude Comparator20Decoders and its applications21Multiplexers22Demultiplexers23Encoders24ROM25Programmable Logic Array (PLA)26Introduction to Sequential Circuits27Basic Flip Flop28Clocked RS Flip Flop29Clocked D Flip Flop30Clocked JK Flip Flop31Clocked T Flip Flop32Analysis of Clocked Sequential Circuits33State Reduction and Assignment34Flip Flop Excitation tables35Design Procedure36Design of Counters37Design with State Equations38Introduction to Registers39Shift Registers40Ripple Counters41Synchronous Counters42Timing Sequences43Memory Unit44Random Access Memory45Introduction to Programmable Logic Devices (CPLD, FPGA)46Lab Assignments using tools such as Verilog HDL/VHDL, MultiSim47Familiarization with Digital Electronic Trainer48Logic gates operations49Half Adder Operation50Full Adder Operation51Half Subtractor Operation52Full Subtractor Operation537-Segment Display Operation54Decoder Operation55BCD To 7-Segment Display56Multiplexer Operation57Using Multiplexer and Demultiplexer/Decoder58Multiplexing 7-Segment Displays59Comparator Operations60D Latch and Flip-Flop Operation61Latching BCD Data for Displaying On 7-Segment Display62JK Flip-Flop Operation63Random Access Memories
    7 min read
    Topic 46 of 63
    Topic Study Note Illustration
    46

    Lab Assignments using tools such as Verilog HDL/VHDL, MultiSim

    Lab assignments in digital design typically involve the use of tools such as Verilog HDL , VHDL , and MultiSim to design, simulate, and implement digital circuits....

    Lab Assignments Using Verilog HDL/VHDL and MultiSim

    Lab assignments in digital design typically involve the use of tools such as Verilog HDL, VHDL, and MultiSim to design, simulate, and implement digital circuits. These tools help students and engineers visualize the design flow, perform simulations, and understand the practical aspects of digital circuit design.

    Below are examples of lab assignments and practical exercises that use these tools:


    1. Basic Logic Gates Implementation (Verilog HDL/VHDL)

    Objective:

    Design and simulate simple logic gates using Verilog HDL or VHDL to understand the behavior of AND, OR, NOT, XOR, etc.

    Tasks:

    • Implement AND, OR, NOT, NAND, NOR, XOR, and XNOR gates in Verilog HDL or VHDL.
    • Simulate the circuits in your simulation environment (such as ModelSim or Xilinx Vivado).
    • Use a testbench to verify the functionality of each gate.

    Steps:

    • Write the Verilog or VHDL code for each gate.
    • Create a testbench to apply different input combinations (0s and 1s) to the logic gates and check if the output is as expected.
    • Simulate the code and observe the waveform to verify correctness.
    Verilog Example:
    module AND_Gate(
        input A,
        input B,
        output Y
    );
        assign Y = A & B;
    endmodule
    
    VHDL Example:
    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    
    entity AND_Gate is
        Port ( A : in  STD_LOGIC;
               B : in  STD_LOGIC;
               Y : out  STD_LOGIC);
    end AND_Gate;
    
    architecture Behavioral of AND_Gate is
    begin
        Y <= A AND B;
    end Behavioral;
    

    2. 4-bit Binary Counter (Verilog HDL/VHDL)

    Objective:

    Design a simple 4-bit binary counter and simulate its functionality.

    Tasks:

    • Create a 4-bit counter that increments from 0 to 15 in binary.
    • Implement the counter using a synchronous or asynchronous design.
    • Write a testbench to observe the counting behavior.

    Steps:

    • Design a 4-bit counter using flip-flops (D flip-flops or T flip-flops).
    • Implement the counter logic and create a testbench to verify the correct sequence of output.
    • Simulate the design to check the counter behavior.
    Verilog Example:
    module Binary_Counter(
        input clk,
        input reset,
        output [3:0] count
    );
        reg [3:0] count_reg;
    
        always @(posedge clk or posedge reset)
        begin
            if (reset)
                count_reg <= 4'b0000;
            else
                count_reg <= count_reg + 1;
        end
        
        assign count = count_reg;
    endmodule
    
    VHDL Example:
    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    
    entity Binary_Counter is
        Port ( clk : in  STD_LOGIC;
               reset : in  STD_LOGIC;
               count : out  STD_LOGIC_VECTOR (3 downto 0));
    end Binary_Counter;
    
    architecture Behavioral of Binary_Counter is
        signal count_reg : STD_LOGIC_VECTOR (3 downto 0);
    begin
        process(clk, reset)
        begin
            if reset = '1' then
                count_reg <= "0000";
            elsif rising_edge(clk) then
                count_reg <= count_reg + 1;
            end if;
        end process;
        count <= count_reg;
    end Behavioral;
    

    3. 7-Segment Display Decoder (Verilog HDL/VHDL)

    Objective:

    Design a 7-segment display decoder that takes a 4-bit binary input and drives a 7-segment display.

    Tasks:

    • Implement the 7-segment display decoder to convert a 4-bit binary input to the corresponding segments of the 7-segment display.
    • Simulate the functionality using Verilog or VHDL and verify the display output.

    Steps:

    • Write the logic for each of the segments of the 7-segment display.
    • Map the 4-bit binary input to the appropriate segment output (seven segments).
    • Use a testbench to simulate different 4-bit inputs and verify the corresponding 7-segment display outputs.
    Verilog Example:
    module Seven_Segment_Decoder(
        input [3:0] binary_in,
        output reg [6:0] segments
    );
        always @ (binary_in)
        begin
            case (binary_in)
                4'b0000: segments = 7'b0000001; // Display 0
                4'b0001: segments = 7'b1001111; // Display 1
                4'b0010: segments = 7'b0010010; // Display 2
                4'b0011: segments = 7'b0000110; // Display 3
                4'b0100: segments = 7'b1001100; // Display 4
                4'b0101: segments = 7'b0100100; // Display 5
                4'b0110: segments = 7'b0100000; // Display 6
                4'b0111: segments = 7'b0001111; // Display 7
                4'b1000: segments = 7'b0000000; // Display 8
                4'b1001: segments = 7'b0000100; // Display 9
                default: segments = 7'b1111111; // Error state
            endcase
        end
    endmodule
    

    4. Multiplexer (Verilog HDL/VHDL)

    Objective:

    Design a 4-to-1 multiplexer that selects one of the four inputs based on the 2-bit control signal.

    Tasks:

    • Implement a 4-to-1 multiplexer.
    • Use the multiplexer in different configurations based on the control inputs.
    • Write a testbench and verify the output of the multiplexer for different input combinations.

    Steps:

    • Use a case or if-else statement to implement the multiplexer logic.
    • Simulate the circuit using a testbench and visualize the results.
    Verilog Example:
    module MUX_4to1(
        input [3:0] A,
        input [1:0] sel,
        output Y
    );
        assign Y = (sel == 2'b00) ? A[0] :
                   (sel == 2'b01) ? A[1] :
                   (sel == 2'b10) ? A[2] :
                   (sel == 2'b11) ? A[3] : 1'bz;
    endmodule
    
    VHDL Example:
    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    
    entity MUX_4to1 is
        Port ( A : in  STD_LOGIC_VECTOR (3 downto 0);
               sel : in  STD_LOGIC_VECTOR (1 downto 0);
               Y : out  STD_LOGIC);
    end MUX_4to1;
    
    architecture Behavioral of MUX_4to1 is
    begin
        process(A, sel)
        begin
            case sel is
                when "00" => Y <= A(0);
                when "01" => Y <= A(1);
                when "10" => Y <= A(2);
                when "11" => Y <= A(3);
                when others => Y <= 'Z';
            end case;
        end process;
    end Behavioral;
    

    5. Full Adder and Adder Subtractor Circuit (Verilog HDL/VHDL)

    Objective:

    Design a full adder and a circuit that performs both addition and subtraction.

    Tasks:

    • Implement a full adder using AND, OR, and XOR gates.
    • Implement a 4-bit adder-subtractor that can either add or subtract two 4-bit numbers based on a control signal.

    Steps:

    • Write the full adder logic and test it for different input combinations.
    • Implement the adder-subtractor by controlling the inputs with the help of the addition and subtraction logic.
    • Simulate the designs and verify them using a testbench.
    Verilog Example (Full Adder):
    module Full_Adder(
        input A,
        input B,
        input Cin,
        output Sum,
        output Cout
    );
        assign Sum = A ^ B ^ Cin;
        assign Cout = (A & B) | (B & Cin) | (A & Cin);
    endmodule
    
    VHDL Example (Full Adder):
    library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    
    entity Full_Adder is
        Port ( A : in  STD_LOGIC;
               B : in  STD_LOGIC;
               Cin : in  STD_LOGIC;
               Sum : out  STD_LOGIC;
               Cout : out  STD_LOGIC);
    end Full_Adder;
    
    architecture Behavioral of Full_Adder is
    begin
        Sum <= A XOR B XOR Cin;
        Cout <= (A AND B) OR (B AND Cin) OR (A AND Cin);
    end Behavioral;
    

    Using MultiSim for Circuit Simulation:

    MultiSim is a popular circuit simulation tool used for testing and validating digital and analog circuits. For the lab assignments above, you can use MultiSim to:

    • Create Circuit Designs: Use MultiSim’s graphical interface to build the logic gate circuits, counters, and other digital systems.
    • Simulation: Test the designs with virtual inputs and observe the waveforms, behavior, and logic results.
    • Error Checking: Check for any design errors or glitches in the circuit’s performance.
    • Component Selection: Use pre-built components (e.g., logic gates, flip-flops) or design custom components for your assignment.

    Steps for MultiSim:

    1. Open MultiSim and create a new project.
    2. Use the components toolbar to select logic gates, multiplexers, or counters.
    3. Connect the components as per the lab assignment.
    4. Use the simulation tools to apply test inputs and observe the output.
    5. Modify the circuit if necessary and rerun the simulation to ensure the design behaves as expected.

    These are just a few examples of how Verilog HDL/VHDL and MultiSim can be used in lab assignments. They allow students to design, simulate, and analyze digital systems effectively while gaining hands-on experience with important tools used in digital design.

    ← Previous topic 45
    Introduction to Programmable Logic Devices (CPLD, FPGA)
    Next topic 47 →
    Familiarization with Digital Electronic Trainer

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    7mremaining
    1.2kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Digital Logic Design