DIT11022 - Computer Systems and Architectures
Assignment 01 Solutions

Question 1: Odd Ones & Prime Number Combinational Logic

a. Complete Truth Table

DecimalABCDY1 (Odd 1s)Y2 (Prime)
0000000
1000110
2001011
3001101
4010010
5010101
6011000
7011111
8100010
9100100
10101000
11101111
12110000
13110111
14111010
15111100

b. K-Maps and Simplified Boolean Expressions (SOP)

K-Map for Y1 (Odd number of ones):

AB \ CD00011110
000101
011010
110101
101010

Observation: This forms a checkerboard pattern. No 1s can be grouped. We write the full SOP:
Y1 = A'B'C'D + A'B'CD' + A'BC'D' + A'BCD + AB'C'D' + AB'CD + ABC'D + ABCD'

K-Map for Y2 (Prime Numbers):

AB \ CD00011110
000011
010110
110100
100010

Groups for Y2: Pair(m2,m3) = A'B'C, Pair(m3,m11) = B'CD, Pair(m5,m13) = BC'D, Pair(m5,m7) = A'BD.
Y2 = A'B'C + B'CD + BC'D + A'BD

c. Logic Gate Diagram Guide

Universal Gates (NAND only): Apply De Morgan's Law to Y2.
Y2 = ( (A'B'C)' • (B'CD)' • (BC'D)' • (A'BD)' )'
Draw a 2-level NAND-NAND circuit using the inverted inputs. For Y1, it can be drawn as a 4-input XOR gate if allowed, otherwise, it requires a very large NAND equivalent.

Question 2: BCD to Excess-3 Converter

a. Complete Truth Table

BCD InputExcess-3 Output (Add 3)
ABCDWXYZ
00000011
00010100
00100101
00110110
01000111
01011000
01101001
01111010
10001011
10011100
1010XXXX
1011XXXX
1100XXXX
1101XXXX
1110XXXX
1111XXXX

b. K-Maps and Simplified Boolean Expressions

K-Map for W:

AB \ CD00011110
000000
010111
11XXXX
1011XX
W = A + BC + BD

K-Map for X:

AB \ CD00011110
000111
011000
11XXXX
1001XX
X = B'C + B'D + BC'D'

K-Map for Y:

AB \ CD00011110
001010
011010
11XXXX
1010XX
Y = C'D' + CD

K-Map for Z:

AB \ CD00011110
001001
011001
11XXXX
1010XX
Z = D'

c. Logic Gate Diagram Guide

Instruction: Use basic gates (AND, OR, NOT). Draw 4 input lines A, B, C, D and their NOT inverted lines. Build the product terms with AND gates, and sum them using OR gates for each output W, X, Y, Z based on the above equations.

Question 3: Add 1 to a 4-bit Binary Number

Truth Table

InputOutput (+1)
A3A2A1A0S4S3S2S1S0
000000001
000100010
001000101
001100100
010001001
010101010
011001101
011101100
100001001
100101010
101001101
101101100
110001101
110101110
111001111
111110000

K-Maps and Simplified SOP Expressions

K-Map for S0:

A3A2 \ A1A000011110
001001
011001
111001
101001
S0 = A0'

K-Map for S1:

A3A2 \ A1A000011110
000101
010101
110101
100101
S1 = A1'A0 + A1A0'

K-Map for S2:

A3A2 \ A1A000011110
000011
011100
111100
100011
S2 = A2A1' + A2A0' + A2'A1A0

K-Map for S3:

A3A2 \ A1A000011110
000000
010010
111101
101111
S3 = A3A2' + A3A1' + A3A0' + A3'A2A1A0

K-Map for S4:

A3A2 \ A1A000011110
000000
010000
110010
100000
S4 = A3A2A1A0

Question 4: Design using Four Half-Adders

Explanation for Diagram:
Using the block diagram in the assignment, cascade 4 Half Adders (HA).
- HA0: Input A = A0, Input B = 1. Sum = S0, Carry = C0.
- HA1: Input A = A1, Input B = C0. Sum = S1, Carry = C1.
- HA2: Input A = A2, Input B = C1. Sum = S2, Carry = C2.
- HA3: Input A = A3, Input B = C2. Sum = S3, Carry = S4.
Please draw this exactly as given in your assignment paper.

Question 5: 2-Bit Binary Adder

Truth Table

X1X0Y1Y0CS1S0
0000000
0001001
0010010
0011011
0100001
0101010
0110011
0111100
1000010
1001011
1010100
1011101
1100011
1101100
1110101
1111110

K-Maps and SOP Expressions

K-Map for C (Carry):

X1X0 \ Y1Y000011110
000000
010010
110111
100011
C = X1Y1 + X1X0Y0 + X0Y1Y0

K-Map for S1:

X1X0 \ Y1Y000011110
000011
010101
111010
101100
S1 = X1'X0'Y1 + X1'Y1Y0' + X1Y1'Y0' + X1X0'Y1' + X1'X0Y1'Y0 + X1X0Y1Y0

K-Map for S0:

X1X0 \ Y1Y000011110
000101
011010
111010
100101
S0 = X0'Y0 + X0Y0'

Question 6: Design using Two Full Adders

Explanation for Diagram:
Use two Full Adders (FA) connected in series.
- FA0: Inputs = X0, Y0. Carry-in = 0. Outputs = S0 and Carry out.
- FA1: Inputs = X1, Y1. Carry-in = Carry out from FA0. Outputs = S1 and C (Final Carry).
Please draw this exactly as given in your assignment paper.

Question 7: Even Number and >3 Logic

a. Truth Table

ABCDecimalY1 (Even)Y2 (> 3)
000010
001100
010210
011300
100411
101501
110611
111701

b. K-Maps and Simplified SOP Expressions

K-Map for Y1 (Even Numbers):

A \ BC00011110
01001
11001

Group of 4 cells at col 00 and col 10.
Y1 = C'

K-Map for Y2 (Greater than 3):

A \ BC00011110
00000
11111

Group of 4 cells representing row A=1.
Y2 = A

c. Logic Gate Diagram Guide

Instruction to Draw:
- Draw 3 input lines: A, B, and C.
- Y1: Take a wire from C, pass it through a NOT gate. This is Y1.
- Y2: Take a wire directly from A. This is Y2.
- Input B remains unconnected to any output.