ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Digital Logic Design
    CC-110
    Progress0 / 63 topics
    Topics
    1. Introduction to Digital Systems2. Number Systems3. Introduction to Boolean Algebra4. Basic theorems and properties of Boolean Algebra5. Boolean Functions6. Logic Gates7. NAND and NOR Implementation8. Representation of Function in Sum of Minterms or Product of Maxterms9. Simplification of Boolean function using Karnaugh Map10. Don't care Conditions11. The Tabulation Method12. Introduction to Combinational Logic13. Design of Adders14. Design of Subtractors15. Code Convertors16. Analysis Procedure of Combinational Circuits17. Binary Parallel Adders18. Decimal Adders19. Magnitude Comparator20. Decoders and its applications21. Multiplexers22. Demultiplexers23. Encoders24. ROM25. Programmable Logic Array (PLA)26. Introduction to Sequential Circuits27. Basic Flip Flop28. Clocked RS Flip Flop29. Clocked D Flip Flop30. Clocked JK Flip Flop31. Clocked T Flip Flop32. Analysis of Clocked Sequential Circuits33. State Reduction and Assignment34. Flip Flop Excitation tables35. Design Procedure36. Design of Counters37. Design with State Equations38. Introduction to Registers39. Shift Registers40. Ripple Counters41. Synchronous Counters42. Timing Sequences43. Memory Unit44. Random Access Memory45. Introduction to Programmable Logic Devices (CPLD, FPGA)46. Lab Assignments using tools such as Verilog HDL/VHDL, MultiSim47. Familiarization with Digital Electronic Trainer48. Logic gates operations49. Half Adder Operation50. Full Adder Operation51. Half Subtractor Operation52. Full Subtractor Operation53. 7-Segment Display Operation54. Decoder Operation55. BCD To 7-Segment Display56. Multiplexer Operation57. Using Multiplexer and Demultiplexer/Decoder58. Multiplexing 7-Segment Displays59. Comparator Operations60. D Latch and Flip-Flop Operation61. Latching BCD Data for Displaying On 7-Segment Display62. JK Flip-Flop Operation63. Random Access Memories
    CC-110›Lab Assignments using tools such as Verilog HDL/VHDL, MultiSim
    Digital Logic DesignTopic 46 of 63

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

    7 minread
    1,225words
    Intermediatelevel

    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 load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time7 min
      Word count1,225
      Code examples0
      DifficultyIntermediate