0% found this document useful (0 votes)
36 views13 pages

UNIT 3, Unit4 Projects

The projects of dls is done
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)
36 views13 pages

UNIT 3, Unit4 Projects

The projects of dls is done
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/ 13

UNIT 3: Minimization of Boolean functions: Karnaugh Map Method - Up to five Variables, Don’t Care Map Entries, Tabular

Method.Combinational Logic Circuits: Adders, Subtractors, Comparators, Multiplexers, Demultiplexers, Encoders, Decoders and Code
converters, Hazards and Hazard Free Relations
S.No Title of the Project Components Required Concepts Covered
1 Practical Question: Design 4 variable and 5 variable Python Compiler Minimization
Karnaugh Map Techniques

Hands-on Activity:

1. Write the python program for 4 variable and 5


variable K-Maps.
2. Verify the result

2 Practical Question: In a Quiz Competition consisting of Minimization technique


4 participants and logic gates
the circuit has to promote participants to the next level or
decide the 4 Switches, one green LED,
Winner in the final round. IC74LS00,IC74LS04,
Hands-on Activity: IC74LS32
1. Convert the problem into Boolean Function.
2. Using K-Map Minimisation find the minimal Solution.
3. Obtain the minimum number of Logic gates required
3 Practical Question: Design a 3 bit calculator to perform IC74LS00,74LS04,74LS32 Adder,Subtractor ,code
addition, Subtraction and multiplication 74LS86, converter, Decoder
Hands-on Activity: 74LS47,Seven Segment Display ,C Compiler
1. Build the logic circuit on bread board
2. Verify the logic.
3. Write a C Program and compare the logic with
hardware circuit
4 Practical Question: Design a communication system to IC74LS00/74LS151, Multiplexer
select one of desired channel LEDs, Switches
Hands-on Activity:
1. Build the logic circuit on bread board using Logic
gates/ multiplexer
2. Verify the logic.

5 Practical Question: Implement a Hazard free system for IC74LS00,/74LS04, Hazards


the following LEDs, Switches
Function F=∑(3,4,5,6)
Hands-on Activity:
1. Using K-Map find the Boolean equations and design
the Hazard circuit and Hazard free circuit .
2. Verify the logic and compare the both the circuits
6 Practical Question: Implement basic logic gates using IC74LS157,74LS00, Multiplxer, Logic gates
multiplexer
LEDs,Switches
Hands-on Activity:
1. Using tabular approach design logic gates using
multiplxer.
2. Connect the circuit on the bread board and verify the
logic..
7 Practical Question: Tabular method Python Python Minimization
techniques
Practical Question: Design Tabular
method(minimization technique)using Python

Hands-on Activity:

1. Write the python program for tabular method


2. Verify the result
Project 1

To design a Python program that generates and simplifies 4-variable and 5-variable Karnaugh Maps (K-maps) using proper
simplification rules, we’ll need to:

1. Generate the K-map grid based on minterms or maxterms.


2. Apply K-map simplification rules to group adjacent cells and derive a minimal Boolean expression.
3. Output the simplified Boolean expression.

The key to simplifying K-maps is to group 1s (for SOP, Sum of Products) or 0s (for POS, Product of Sums) in powers of 2, such as
groups of 1, 2, 4, 8, etc., based on adjacency.

Here’s a Python program that creates and simplifies K-maps for 4 and 5 variables.

Full Program for K-Map Simplification

import numpy as np

import pandas as pd

# Gray code for mapping positions in the K-map

def gray_code_order(num_vars):

if num_vars == 4:

return [

[0, 1, 3, 2],

[4, 5, 7, 6],
[12, 13, 15, 14],

[8, 9, 11, 10]

elif num_vars == 5:

return [

[0, 1, 3, 2, 8, 9, 11, 10],

[4, 5, 7, 6, 12, 13, 15, 14],

[20, 21, 23, 22, 28, 29, 31, 30],

[16, 17, 19, 18, 24, 25, 27, 26]

else:

raise ValueError("Only 4 and 5 variables are supported.")

# Generate the K-map with minterms (1s) or maxterms (0s)

def generate_kmap(num_vars, minterms=None, maxterms=None):

if minterms is None:

minterms = []

if maxterms is None:
maxterms = []

grid_shape = (4, 4) if num_vars == 4 else (4, 8)

kmap_grid = np.full(grid_shape, ' ')

order = gray_code_order(num_vars)

for i in range(len(order)):

for j in range(len(order[0])):

term = order[i][j]

if term in minterms:

kmap_grid[i][j] = '1'

elif term in maxterms:

kmap_grid[i][j] = '0'

else:

kmap_grid[i][j] = ' '

return pd.DataFrame(kmap_grid), kmap_grid


# Simplify the K-map by grouping adjacent 1's (for SOP)

def simplify_kmap(kmap_grid, num_vars):

rows, cols = kmap_grid.shape

visited = np.zeros((rows, cols), dtype=bool)

terms = []

def is_adjacent(r1, c1, r2, c2):

return (r1 == r2 and abs(c1 - c2) == 1) or (c1 == c2 and abs(r1 - r2) == 1)

# Find groups

def find_group(r, c):

if visited[r, c] or kmap_grid[r][c] != '1':

return []

stack = [(r, c)]

group = []

while stack:

cr, cc = stack.pop()

if visited[cr, cc]:
continue

visited[cr, cc] = True

group.append((cr, cc))

# Explore all neighbors

for nr, nc in [(cr, (cc + 1) % cols), ((cr + 1) % rows, cc),

(cr, (cc - 1) % cols), ((cr - 1) % rows, cc)]:

if not visited[nr, nc] and kmap_grid[nr][nc] == '1':

stack.append((nr, nc))

return group

for i in range(rows):

for j in range(cols):

if kmap_grid[i][j] == '1' and not visited[i, j]:

group = find_group(i, j)

if group:

terms.append(group)

# Generate expression from groups


def group_to_term(group):

vars_map = ["A", "B", "C", "D", "E"][:num_vars]

min_row, min_col = np.min(group, axis=0)

max_row, max_col = np.max(group, axis=0)

term = []

if min_row == max_row:

term.append(vars_map[0] + ("'" if min_row == 1 else ""))

if min_col == max_col:

term.append(vars_map[1] + ("'" if min_col == 1 else ""))

return "".join(term)

simplified_expression = " + ".join([group_to_term(g) for g in terms])

return simplified_expression if simplified_expression else "1"

# Define minterms for testing

minterms_4var = [0, 1, 5, 7, 10, 14]

minterms_5var = [0, 2, 5, 7, 8, 12, 18, 25, 27]


# Generate and simplify the 4-variable K-map

kmap_4var_df, kmap_4var_grid = generate_kmap(4, minterms=minterms_4var)

print("4-variable K-map:")

print(kmap_4var_df)

print("Simplified Expression for 4-variable K-map:")

print(simplify_kmap(kmap_4var_grid, num_vars=4))

# Generate and simplify the 5-variable K-map

kmap_5var_df, kmap_5var_grid = generate_kmap(5, minterms=minterms_5var)

print("\n5-variable K-map:")

print(kmap_5var_df)

print("Simplified Expression for 5-variable K-map:")

print(simplify_kmap(kmap_5var_grid, num_vars=5))

Explanation of the Code

1. Gray Code Order Function: gray_code_order returns the Gray code order matrix for either a 4-variable or 5-variable K-
map. This helps place minterms or maxterms in the correct cells.
2. Generate K-map Grid: generate_kmap creates the K-map grid using minterms or maxterms and fills it with 1s or 0s
accordingly. It returns a DataFrame and the raw grid for processing.
3. Simplification Function: simplify_kmap identifies and groups adjacent cells containing 1s to simplify the Boolean
expression for SOP:
o Grouping: Uses depth-first search to group adjacent cells containing 1s.
o Expression Generation: Converts each group into a Boolean term based on common variables.
4. Testing with Example Minterms: Finally, the code displays the K-map for both 4 and 5 variables and shows the simplified
Boolean expression.

This program is structured to handle basic simplification of K-maps for SOP expressions. Further optimizations could handle more
complex wrap-around cases and larger groups.

4o
Project 2

https://youtu.be/aUq3-K3teig?si=3rKHv3Sun_Dcle0R
Project 3
Circuit digram link

https://circuitverse.org/users/60560/projects/3-bit-binary-adder-subtractor-a32f81e9-dc25-40dd-bbae-46f80f99b75a

https://youtu.be/u863cwgdlnA?si=f4v-bR3ssCBaBeEW

https://youtu.be/xLmXrgjwdDQ?si=4GaRJU56cctL9_dD

https://youtu.be/o87GH5U1zUY?si=rCuqgonoZ2TaMy8n

Project 4

https://www.chegg.com/homework-help/questions-and-answers/design-digital-breadboard-circuit-implement-following-digital-function-using-
8-1-multiplex-q73396173

Project 5

https://www.youtube.com/watch?v=h4uVk3gsBUM
UNIT 4: Sequential Circuits Fundamentals: Basic Architectural Distinctions between
Combinational and Sequential circuits, SR Latch, Flip Flops: SR, JK, JK Master Slave, D and T Type Flip Flops, Excitation Table of all
Flip Flops, Timing and Triggering Consideration, Conversion from one type of Flip-Flop to another.
Registers and Counters: Shift Registers -Left, Right and Bidirectional Shift Registers, Applications of Shift Registers - Design and
Operation of Ring and Twisted Ring Counter, Operation and design of Asynchronous and Synchronous Counters.
,
S.No Title of the Project Concepts Covered

1 Practical Question: Design a Digital Stopwatch IC’s Finite State Machines

Hands-on Activity:

1. Convert the problem into Boolean Function.


2. Using FSM Minimisation find the minimal
Solution.
3. Obtain the minimum number of IC’s and
Logic gates required

2 Practical Question: Design an LED Cube using Asynchronous and


Decade Counter Synchronous
Counters.
Hands-on Activity: Decade Counter IC (CD 4017 IC),
Connecting Wires, Resistors
 Realisation of Decade Counter
 Design of Decade Counter using ICs

3 Practical Question: Design a Digital Object Counter IC’s, Resistors, Clock Pulse Generator Asynchronous and
Synchronous
Hands-on Activity: Counters.

 Realisation of Mod 8 Counter


 Implementation of Counter using ICs

4 Practical Question: Design a currency Counting counters


machine using Photo Diode and Decade Counter

Hands-on Activity:
IR sensor, Light Source, Counting Machine
template
 Realisation of Stimulus circuit for the IR and
Counter
 Design of the Decade Counter using ICs

5 Practical Question: Implementation of Memories Shift Registers – Left,


Right and
Hands-on Activity: Bidirectional Shift
Flip Flops and Register ICs Registers
 Realisation of Memories RAM and ROM
 Design of RAM and ROM using ICs

You might also like