Step 1: Create Basic Modules
A. 4-bit Register
1. Go to Memory → Register.
2. Place two registers (Register A and Register B).
3. Set Bit Width = 4.
4. Add:
o Input pins (4) for data input.
o Load pin (switch) → connected to the Load input of the register.
o Clock → connect a clock component.
5. Label outputs as A_out[3:0] and B_out[3:0].
Now you have 2 registers to hold operands.
B. ALU (Adder/Subtractor)
1. Go to Arithmetic → Adder and place one.
2. Set Bit Width = 4.
3. Connect:
o Register A output → Adder input A
o Register B output → Adder input B
4. To make it Adder/Subtractor:
o Add XOR gates between Register B output and Adder input B.
o Add a control switch labeled Add/Sub.
o Connect Add/Sub to all XOR gate control inputs.
o Also connect Add/Sub to the Carry In (Cin) of the adder.
When Add/Sub = 0 → Addition
When Add/Sub = 1 → Subtraction
5. Connect adder output to an output register or LEDs.
C. Control Unit
Since this is a simple manual control design:
1. Use Input Pins / Switches for:
o LoadA
o LoadB
o Add/Sub
o Clock
o Memory Read/Write
2. Connect each to corresponding control inputs of Register and ALU.
You now have manual control over each step of the CPU cycle.
D. Memory (ROM or RAM)
1. Go to Memory → ROM or Memory → RAM.
2. Set Address Bit Width = 4, Data Bit Width = 4.
3. Right-click → Edit Contents:
o Example data:
o 0000: 0101 (Value = 5)
o 0001: 0011 (Value = 3)
4. Connect:
o Address input (from switches or counter)
o Data output → Register input (A or B)
Now you can fetch values from memory and load into registers.
Step 2: Connect Modules Together
Make the data path like this:
ROM (Memory) → Register A → ALU → Register B → Output LEDs
Example:
• Load value from ROM address 0 into Register A.
• Load value from ROM address 1 into Register B.
• Set Add/Sub = 0 for addition.
• Observe output on LEDs.
Step 3: Load a Simple Instruction Sequence
Use manual steps (switches) as control signals:
1. Set memory address = 0000, press LoadA = 1 → Load Register A.
2. Set memory address = 0001, press LoadB = 1 → Load Register B.
3. Set Add/Sub = 0, pulse Clock → Perform addition.
4. Observe ALU output.
Step 4: Run and Observe
Check:
• Data flow (memory → register → ALU)
• Operation result (Sum/Sub)
• Control signal effect (manual CPU control)
You’ll see the ALU result light up in output LEDs (e.g., 0101 + 0011 = 1000).
Final Output
When done, you’ll have a working mini-computer simulation:
• Inputs: switches for control
• Registers: store data
• ALU: perform add/sub
• Memory: store values
• Outputs: LEDs show result
Diagram
Deliverables
• Save your file as [Link]
• Take screenshots showing:
o Circuit layout
o Simulation outputs for addition/subtraction
Experiment 3: Implementation of Basic Logic Gates and Combinational Circuits
Purpose
To design, simulate, and verify the operation of basic logic gates and combinational circuits
using Logisim Evolution.
Tools Needed
• Software: Logisim Evolution (free download)
• Components used:
o Input Pins (Switches)
o Output Pins (LEDs)
o Logic Gates (AND, OR, NOT, etc.)
o Adder, XOR, Multiplexer, Decoder, etc.
Step-by-Step Procedure
Step 1: Open Logisim Evolution
1. Launch Logisim Evolution.
2. Go to File → New Project.
3. Save your file as Logic_Gates_And_Circuits.circ.
Step 2: Design and Test Basic Logic Gates
Example 1: AND Gate
1. Place two Input Pins (Wiring → Input Pin).
2. Place one AND Gate (Gates → AND).
3. Place one Output Pin (Wiring → Output Pin).
4. Connect both inputs to the AND gate inputs, and the AND gate output to the output pin.
Repeat the same setup for these gates:
• OR gate (Gates → OR)
• NOT gate (Gates → NOT)
• NAND gate (Gates → NAND)
• NOR gate (Gates → NOR)
• XOR gate (Gates → XOR)
• XNOR gate (Gates → XNOR)
Testing:
• Toggle input pins (0 or 1).
• Observe LED output (0 = OFF, 1 = ON).
• Compare with the truth table.
Step 3: Build Combinational Circuits
(a) Half Adder
• Logic:
o Sum = A XOR B
o Carry = A AND B
Steps:
1. Place 2 input pins (A, B).
2. Place XOR gate → output = Sum.
3. Place AND gate → output = Carry.
4. Add two output LEDs for Sum and Carry.
Test:
Try combinations (00, 01, 10, 11) → verify with truth table.
A B Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
(b) Full Adder
• Logic:
o Sum = A XOR B XOR Cin
o Carry = (A·B) + (Cin·(A⊕B))
Steps:
1. Place 3 inputs (A, B, Cin).
2. Connect:
o XOR gates for the sum logic.
o AND + OR gates for carry.
3. Add 2 output LEDs for Sum and Carry.
Tip:
You can also create this using two half adders + one OR gate:
Half Adder 1: Inputs A, B → S1, C1
Half Adder 2: Inputs S1, Cin → S, C2
Carry = C1 OR C2
Test:
Use all 8 input combinations.
(c) 4-bit Adder
• Use the Adder component from Arithmetic → Adder.
• Set Bit Width = 4.
• Connect:
o A[3:0] inputs (from 4 switches)
o B[3:0] inputs (from another 4 switches)
o Carry In (0 or switch)
o Output LEDs for 4-bit Sum + Carry Out
Test cases:
Example — A=0101 (5), B=0011 (3) → Sum=1000 (8), Carry=0.
(d) Multiplexer
Steps:
1. From Plexers → Multiplexer.
2. Choose 2-to-1 MUX.
3. Connect:
o Two data inputs (D0, D1)
o One select line (S)
o Output LED.
4. When S=0 → Output=D0; when S=1 → Output=D1.
Try also 4-to-1 MUX with 2 select lines.
(e) Decoder (2-to-4)
Steps:
1. From Plexers → Decoder.
2. Choose 2-to-4 Decoder.
3. Connect:
o Two input pins for A0, A1.
o Four output LEDs (Y0–Y3).
4. Observe which output turns ON for each input combination.
A1 A0 Y0 Y1 Y2 Y3
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1
Step 4: Verification
For each circuit:
1. Create a truth table (input → output).
2. Toggle switches for all input combinations.
3. Confirm that outputs match theoretical results.
Take screenshots showing:
• The designed circuit.
• LED outputs for different test cases.
Diagram:
Deliverables
1. .circ file — e.g., Exp3_Logic_Circuits.circ
2. Screenshots for each circuit.
3. Truth tables (can be included in your lab report)