# Lab 3 - Exercise 0

## Question

1. Y=1 if A(MSB) B C D(LSB) = 0, 2, 8, 10, 12, 13, 14, 15 else 0. Identify the Boolean logic for Y & Implement the same in WOKWI tool.

## Solution

* Expression in SOP form is `Y = A'.B'.C'.D' + A'.B'.C.D' + A.B'.C'.D' + A.B'.C.D' + A.B.C'.D' + A.B.C'.D + A.B.C.D' + A.B.C.D`
* Final Expression after solving K-Map is `Y = A.B + B'.D'`, which is implemented here using logic gates.

## Truth Table for expression

| A | B | C | D | Y |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 0 | 0 | 0 | 1 | 0 |
| 0 | 0 | 1 | 0 | 1 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 | 0 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
led1:A
led1:C
sw1:1
sw1:2
sw1:3
sw2:1
sw2:2
sw2:3
sw3:1
sw3:2
sw3:3
vcc1:VCC
gnd1:GND
sw4:1
sw4:2
sw4:3
and1:A
and1:B
and1:OUT
not1:IN
not1:OUT
not2:IN
not2:OUT
and2:A
and2:B
and2:OUT
or1:A
or1:B
or1:OUT