# Lab 2 (Part 2) - Exercise 7

## Question

1. Find the logic expression for output high when majority of bits are high and output low when majority of bits are low for 3 bit system?

## Solution

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

## Truth Table for expression `Y = A'.B.C + A.B'.C + A.B.C' + A.B.C`

| A | B | C | Y |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
vcc1:VCC
sw1:1
sw1:2
sw1:3
sw2:1
sw2:2
sw2:3
sw3:1
sw3:2
sw3:3
led1:A
led1:C
gnd1:GND
or1:A
or1:B
or1:OUT
or2:A
or2:B
or2:OUT
and1:A
and1:B
and1:OUT
and2:A
and2:B
and2:OUT
and3:A
and3:B
and3:OUT