BCA 1st Year Computer Architecture Lab
BCA 1st Year Computer Architecture Lab
YEAR
PRACTICAL
WORK PLACE
ACCURATE INSTITUTE OF MANAGEMENT AND TECHNOLOGY(AIMT), GREATER NOIDA (UP)
INDEX
Date of
[Link]. TOPICS [Link]. Experiment
OBJECTIVE: Verify the logic behaviour of AND, OR, NAND, NOR, EX-OR, EX-
NOR GATES
BRIEF DESCRIPTION:
To Verify the logic behaviour of AND, OR, NAND, NOR, EX-OR, EX-NOR
AND GATE:
OUTPU
INPUT INPUT
T
A B
Y=A.B
0 0 0
0 1 0
1 0 0
1 1 1
OUTPU
INPUT INPUT
T
A B
Y=A+B
0 0 0
0 1 1
1 0 1
1 1 1
NAND GATE:
NOR GATE:
EX-OR GATE:
OUTPUT
INPUT INPUT
Y =A′B+AB′
A B
Or A⊕B
0 0 0
0 1 1
1 0 1
1 1 0
CIRCUIT DIAGRAM
TRUTH TABLE
EX-NOR GATE:
OUTPUT
INPUT INPUT
Y =A⊕B’
A B
Or A⊙B
0 0 1
0 1 0
1 0 0
1 1 1
PRE-EXPERIMENT QUESTIONS: -
1. Explain the gates by the Circuit Diagram and verify it through the Truth Table.
2. How do the Gates Work?
PROCEDURE: -
POST-EXPERIMENT QUESTIONS: -
1. How are the universal gates used for making other gates?
2. What are the uses of gates?
EXPERIMENT-2
BRIEF DESCRIPTION:
PRE-EXPERIMENT QUESTIONS: -
1. Explain how the Universal gates can me used to form all other logic gates?
2. How do using the same gate used for making outputs of different gates?
EXPERIMENT-3
A B A⋅B A ´⋅ B Á B́ Á+ B́ A+ B ´B
A+ Á ⋅ B́
0 0 0 1 1 1 1 0 1 1
0 1 0 1 1 0 1 1 0 0
1 0 0 1 0 1 1 1 0 0
1 1 1 0 0 0 0 1 0 0
PRE-EXPERIMENT QUESTIONS: -
PROCEDURE: -
Testing
Apply all possible logic combinations to inputs A and B (00, 01, 10, 11).
For each combination, observe and record the outputs of both sides (LHS and RHS)
simultaneously.
Note the readings in a truth table.
Verification
Compare LHS and RHS outputs for every input combination.
If both outputs match for all inputs, the theorem is verified practically.
POST-EXPERIMENT QUESTIONS: -
[Link] would you realize De Morgan’s equivalent forms using only NAND or NOR gates?
2. Is it possible to implement any logic function using only NAND or NOR gates? Why?
EXPERIMENT-4
OBJECTIVE: Design and test and S-R flip flops using NAND/NOR Gate
BRIEF DESCRIPTION:
Design and test and S-R flip flops using NAND/NOR Gate
This diagram shows an SR Flip-Flop (Set-Reset Flip-Flop) built using NAND gates.
Explanation:
1. Inputs:
The boxes labelled "1" and "0" on the left are the inputs:
S (Set): Input at the top (currently ‘1’).
R (Reset): Input at the bottom (currently ‘0’).
2. Circuit Gates:
Each rectangle with a small circle at the output is a NAND gate.
This circuit uses four NAND gates, which is standard for an SR flip-flop
implementation.
3. Connections:
The S and R inputs each go into two NAND gates (one with cross-feedback).
The outputs of these gates are cross-coupled to the inputs of the other pair of NAND
gates—this creates the memory effect.
4. Outputs:
The two RIGHTMOST lines go to indicators (such as LEDs).
The top LED (red) is ON; this represents Q = 1 (Set state).
The bottom LED (Gray/off) is OFF; this represents Q̅ = 0 (Reset complement).
5. Current State (with S=1, R=0):
Setting S=1 and R=0 on an SR NAND flip-flop:
Q = 1, Q̅ = 0
This means the flip-flop is in the Set state (top LED ON).
0 1 1 0 Set
1 0 0 1 Reset
Key Points:
This is a classic bistable multivibrator (SR NAND flip-flop).
The state depends on the S and R inputs.
Flip-flops are basic memory elements used for storing binary data in digital circuits.
S R Q (Current Q̅ State/Action
(Set) (Reset) Output) (Complement)
1 0 1 0 Set (Q = 1)
0 1 0 1 Reset (Q = 0)
PRE-EXPERIMENT QUESTIONS: -
1. Explain the roles of the S (Set) and R (Reset) inputs. What happens to the outputs for
each input combination?
2. How many stable states does an SR flip-flop have? What are they?
POST-EXPERIMENT QUESTIONS: -
1. How do the output behaviours differ between the NOR-based and NAND-based SR
flip-flop circuits?
2. Describe a practical application for an SR flip-flop in digital electronics.
EXPERIMENT-5
BRIEF DESCRIPTION:
: Convert BCD to Excess-3 code using NAND Gate using an example.
Diagram
Inputs
A, B, C, D at the top left are the BCD code inputs (A = most significant, D = least
significant).
Each input line feeds into several gates (directly and sometimes via a NOT gate).
Logic Gates
NOT gates: Triangular symbols with a small circle at the output. Used to invert A, B,
C, or D where needed.
NAND gates: Shaped like standard logic gates with a small circle at the output. All
main logic in this diagram is built from NAND gates.
Logic Flow
Outputs
W, X, Y, Z at the bottom are the 4 bits of the Excess-3 code, with LEDs or indicators.
For the current BCD input, only 'X' appears to be active (red), while others are off
(Gray).
Excess-3 code is generated by adding 3 (binary 0011) to the BCD digit. The Boolean
functions for each output bit are derived from a truth table mapping BCD to Excess-3.
For example, if BCD = 0000 (decimal 0), Excess-3 should be 0011.
Each output (W, X, Y, Z) is expressed as a logic equation using the BCD inputs, then
implemented using only NAND gates.
PROCEDURES
PRE-EXPERIMENT QUESTIONS: -
POST-EXPERIMENT QUESTIONS: -
[Link] are the advantages and disadvantages of using only NAND gates in such code
conversions?
[Link] you had to convert Excess-3 code back to BCD, would the logic and implementation
be similar or different? Explain.
EXPERIMENT-6
BRIEF
DESCRIPTION:
Binary-to-Gray code conversion is used in digital electronics to minimize errors during
state changes. In Gray code, only one-bit changes at each step, which is useful for digital
encoders and error-reduction in digital circuits
This diagram visually explains how to convert a binary number to its equivalent Gray
code using a step-by-step method. It specifically converts the 5-bit binary number ¿ to its
Gray code ¿.
The arrows and ⊕ symbols indicate the XOR operation between each
G 1=B2 ⊕ B1 =1⊕ 0=1
pair.
The resulting Gray code below the binary row is 1 1 0 1 1.
Final Result
The diagram states explicitly:
¿
Meaning the binary number 10010 converts to Gray code 11011.
PROCEDURES
PRE-EXPERIMENT QUESTIONS: -
POST-EXPERIMENT QUESTIONS: -
EXPERIMENT-7
OBJECTIVE: Verify the truth tables of J-K flip flop using NAND/NOR Gates
BRIEF DESCRIPTION:
Verify the truth tables of J-K flip flop using NAND/NOR Gates
The cross-coupled arrangement and feedback between gates allow this toggle and
memory behavior.
1. Apply various combinations of J, K, and clock input to the circuit.
2. Observe output Q (LED) and Q́ (gray bulb) for each state.
3. Fill in the truth table for the JK flip-flop:
Memory/
0 0 0/1 Q Hold
0 1 0/1 0 Reset
1 0 0/1 1 Set
1 1 0/1 Q̅ Toggle
Basic JK
Flip-Flop
Operation with NOR Gates:
The NOR gates are cross-coupled.
J, K, and clock inputs control how Q and Q́ change state.
0 0 High Q Q́ Hold
1 0 High 1 0 Set
0 1 High 0 1 Reset
Toggl
1 1 High Toggle e Toggle
PROCEDURES
1. Build the circuit with four NOR gates as shown (cross-coupled for feedback).
Connect input switches to J and K, and a pulse/button or clock generator to the clock
input.
2. Set J = 1, K = 0, and provide a clock pulse:
You should observe: Q (red LED) turns ON, Q́ (gray) stays OFF (Set state).
3. Change input combinations: Test (J,K) = (0,1), (1,1), (0,0) and pulse the clock each
time. Observe Q and Q́ for each case.
4. Complete the truth table: For each combination, record Q and Q́ , verifying with
expected JK flip-flop behavior.
PRE-EXPERIMENT QUESTIONS: -
POST-EXPERIMENT QUESTIONS: -
1. What output did you observe when both J and K were high during a clock pulse?
2. Did the circuit 'remember' its state when J = K = 0?
EXPERIMENT-8
OBJECTIVE: Realize Decoder and Encoder circuits using basic gates.
Decoder
A decoder converts 3 binary input signals into 8 unique output lines, with only one
output HIGH (logic 1) at any given input combination.
Summary
Three inputs are decoded so only one of
eight outputs is HIGH.
Makes use of NOT gates (to create
complemented inputs) and AND gates (to
select the right output).
Encoder
An encoder circuit compresses 2ⁿ input lines to n output lines. Here, only one input should
be HIGH at a time.
Inputs
I0 to I7: 8 input lines, each corresponding to a
unique condition or device.
Only one input should be HIGH ('1') at a time for
standard encoder operation.
Encoder Block
Central box labeled "8:3 Encoder".
Indicates the internal logic circuit performs the
encoding task.
Outputs
Y0, Y1, Y2: 3 output lines.
These outputs represent the binary value of the
active input, forming a 3-bit binary code.
T
his truth table shows the encoder's behavior: a single active input is converted to its
binary address on outputs A, B, C.
Useful for digital circuits where many signals need to be encoded into a few lines
(e.g., keypad, interrupt requests).
CIRCUIT DIAGRAM OF 3X8 ENCODER
Summary
Purpose: Converts one of 8 active input lines into a binary output code.
Implementation: Each output uses a 4-input OR gate.
PROCEDURES
Draw the Truth Table: List all input combinations for Encoder and decoders and their
corresponding output lines.
Write Boolean Equations: Express each output as an AND / OR of the correct mix of
direct/inverted inputs.
Implement Circuit: Arrange NOT gates for each input, then wire AND gates per your
equations (for decoder)
Test Function: Set all input combinations, one by one; record which output goes
HIGH.
Verify Truth Table: Ensure only the intended output activates for each input set.
PRE-EXPERIMENT QUESTIONS: -
POST-EXPERIMENT QUESTIONS: -
1. Did your decoder activate only one output for each input combination? What
happened if you set multiple outputs?
2. Why is it important to test all possible input combinations?
EXPERIMENT-9
OBJECTIVE: Design and implement a 4:1 MUX using gates.
BRIEF DESCRIPTION:
Design and implement a 4:1 MUX using gates.
This diagram is a standard implementation of a 4:1 multiplexer using NOT, AND, and
OR gates.
It allows selection of one among four inputs under control of two select lines.
General Procedure
1. Connect both gate inputs (A, B) to MUX select lines (S1, S0).
2. Set MUX data inputs (D0, D1, D2, D3) to realize the desired gate’s truth table.
Each data input corresponds to a unique value of select lines:
S1 S0 = 00 → D0,
S1 S0 = 01 → D1,
S1 S0 = 10 → D2,
S1 S0 = 11 → D3.
AND Gate:
A B Output (A · B)
0 0 0
0 1 0
1 0 0
1 1 1
OR Gate:
A B Output (A + B)
0 0 0
0 1 1
1 0 1
1 1 1
PROCEDURES
PRE-EXPERIMENT QUESTIONS: -
POST-EXPERIMENT QUESTIONS: -
1. How did you verify the final output for each select line combination?
2. Describe the practical importance of multiplexers in digital systems.
EXPERIMENT-10
OBJECTIVE: Design and verify the operation of a half adder and full adder
BRIEF DESCRIPTION:
Design and verify the operation of a half adder and full adder
Half Adder
Logic Functions:
Inputs: A, B (single bits)
Outputs:
Sum (S): S= A ⊕ B (XOR gate)
Carry (C): C= A ⋅ B (AND gate)
A B S (Sum) C (Carry)
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Full Adder
Logic Functions:
Inputs: A, B, C ¿ (carry-in)
Outputs:
Sum (S): S= A ⊕ B ⊕ C ¿
Carry (C_{out}): C out =(A ⋅B)+(B ⋅C ¿ )+( A ⋅C ¿ ) (three ORed ANDs)
TRUTH TABLE
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
CIRCUIT DIAGRAM
PROCEDURES
4. Verify Logic:
Confirm the logic equations by observed results.
PRE-EXPERIMENT QUESTIONS: -
POST-EXPERIMENT QUESTIONS: -
1. Did the adder circuits work for every input combination? If not, why?
2. How does the observed output compare with the truth table?
EXPERIMENT-11
OBJECTIVE: Design and verify the operation of a half subtractor.
BRIEF DESCRIPTION:
Design and verify the operation of a half subtractor.
A half subtractor is a digital circuit that computes the subtraction of two single-bit
binary numbers (A - B), providing both the difference (D) and borrow (Bo) outputs.
Truth Table
A B D (Difference) Bo (Borrow)
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
CIRCUIT DIAGRAM
Inputs: A, B
Outputs:
Difference (D): D= A ⊕ B
(XOR gate)
Borrow (Bo): Bo= Á ⋅ B (NOT/AND gates)
PROCEDURES
1. Construct the circuit using one XOR gate (for D) and one NOT plus one AND gate (for
Bo).
2. Apply all possible input combinations (A, B: 00, 01, 10, 11).
4. Compare the observed outputs to the truth table above to verify correct operation
PRE-EXPERIMENT QUESTIONS: -
POST-EXPERIMENT QUESTIONS: -
1. Did your half subtractor circuit produce the expected difference and borrow outputs for
all input combinations?
2. How does the borrow output behave when A is less than B?
EXPERIMENT-12
OBJECTIVE: Design and implement a 4-bit shift register using flip-flops.
BRIEF DESCRIPTION:
Design and implement a 4-bit shift register using flip-flops.
How It Works
Inputs:
Serial Input: The data stream (sequence of 1s and 0s) to be loaded into the register
one bit at a time.
Clock: All flip-flops share a common clock input, controlling when information shifts.
Flip-Flops:
Four flip-flops (FF1 to FF4): Each is a D-type flip-flop (D = Data input, Q = Output).
The Q output of each flip-flop connects to the D input of the next flip-flop.
Operation:
PROCEDURES
PRE-EXPERIMENT QUESTIONS: -
POST-EXPERIMENT QUESTIONS: -
OBJECTIVE: Implement Boolean functions using logic gates in both SOP and
POS forms.
BRIEF DESCRIPTION:
Implement Boolean functions using logic gates in both SOP and POS
forms.
Example Function:
F (A , B , C)= Á BC + AB Ć+ ABC
Circuit Implementation:
AND Gates: For each product term:
Term 1: Á BC
Term 2: AB Ć
Term 3: ABC
OR Gate: Combine all three AND outputs.
Steps:
1. Use NOT gates to create complements Á , Ć .
2. Use AND gates for each term.
3. Use one OR gate to combine the outputs of all AND gates.
Example Function:
F (A , B , C)=( A+ B+ Ć)( Á +B+ C)( A+ B́+C)
Circuit Implementation:
OR Gates: For each sum term:
Term 1: A+ B+ Ć
Term 2: Á+ B+C
Term 3: A+ B́+C
AND Gate: Combine the outputs of all OR gates.
Steps:
1. Use NOT gates to generate needed complements ( Á , B́, Ć ).
2. Use OR gates for each term.
3. Use one AND gate to combine all OR gate outputs.
Summary Table
SOP Implementation POS Implementation
PROCEDURES
PRE-EXPERIMENT QUESTIONS: -
POST-EXPERIMENT QUESTIONS: -
1. How would you simplify a complex Boolean function for gate-level implementation?
2. Summarize how gate arrangements differ between SOP and POS forms.
EXPERIMENT-14
OBJECTIVE: Design and implement a 4-bit synchronous counter.
BRIEF DESCRIPTION:
Design and implement a 4-bit synchronous counter.
Working Principle
Synchronous Counter: All flip-flops are triggered on the same clock edge—so all
outputs change simultaneously, avoiding timing glitches seen in ripple
(asynchronous) counters.
Up Counter: Counts upward (binary 0 to 15 with 4 bits: Q3 Q2 Q1 Q0).
Circuit Components
Clock: One clock line feeds all flip-flops.
Four JK Flip-Flops: Every stage is a JK FF with both J and K tied high (to toggle).
AND gates: Control when each flip-flop toggles.
Operation Summary
On each clock pulse:
Q0 toggles.
Q1 toggles when Q0=1.
Q2 toggles when Q0=1 AND Q1=1.
Q3 toggles when Q0=1 AND Q1=1 AND Q2=1.
Output Q3-Q0 moves through binary count: 0000, 0001, 0010, ..., up to 1111.
PROCEDURES
1. Draw the schematic diagram of a 4-bit synchronous counter using four JK (or T) flip-
flops and the required AND gates for control logic (refer to attached diagram).
2. Wire all flip-flops to a common clock source so every flip-flop is triggered
simultaneously.
3. Connect the J and K inputs of each flip-flop:
FF0: J=K=1 (always toggles)
FF1: J=K=Q0
FF2: J=K=Q0·Q1
FF3: J=K=Q0·Q1·Q2
4. Provide power supply and initialize all flip-flop outputs (Q0–Q3) to 0.
5. Apply clock pulses one at a time.
6. Observe and record the outputs Q0–Q3 after each pulse; they should increment in
binary count sequence.
7. Verify the counting pattern matches expected binary counting (0000 to 1111).
8. Repeat and document results for several cycles to confirm reliable operation.
PRE-EXPERIMENT QUESTIONS: -
POST-EXPERIMENT QUESTIONS: -
1. How do simultaneous clocking and AND gate logic ensure proper synchronization?
2. What happens when the counter reaches its maximum state (1111) and a new clock
pulse is received?
EXPERIMENT-15
OBJECTIVE: Design and verify a 4-bit asynchronous counter.
BRIEF DESCRIPTION:
Design and implement a 4-bit Asynchronous counter.
How It Works
Because each flip-flop is clocked by the output of its predecessor, this design is called
a ripple (asynchronous) counter.
As clock pulses are applied:
Q0 changes state every pulse.
Q1 changes every two pulses (Q0 toggling from 1 to 0).
Q2 every four pulses.
Q3 every eight pulses.
Counting Output
0 0 0 0 0
0 0 0 1 1
0 0 1 0 2
1 1 1 1 15
After the 16th clock pulse, the counter resets to 0000 and repeats.
Key Points
Summary:
A four-bit up ripple counter uses JK flip-flops tied in series and toggles the next stage on the
trailing edge of the previous stage’s output, producing a binary count sequence.
PROCEDURES
1. Draw the circuit diagram: Four JK (or T) flip-flops in series, each Q output
connects to the clock input of the next flip-flop.
2. Connect the clock signal: Feed the clock only to the first flip-flop; do not
connect clock directly to the others.
3. Set J and K inputs of each flip-flop to logic '1' (toggle mode).
4. Power the circuit: Apply Vdd and ground as shown.
7. Observe outputs Q0–Q3: Record the output after each pulse. You should see
a binary counting sequence, with ripple effect through each stage.
8. Continue through 16 clock pulses: Note the binary count pattern from 0000
up to 1111, then repeating.
PRE-EXPERIMENT QUESTIONS: -
POST-EXPERIMENT QUESTIONS: -
1. How does the ripple effect differ between synchronous and asynchronous counters?