Logic Circuit and Design (LABORATORY) Prelims
Logic Circuit and Design (LABORATORY) Prelims
Introduction
Computer Engineers must have interest in the fundamentals of digital systems. The Beauty of designing
such a system then creating it is important to allow machines to do intricate computing thing. Digital systems
building blocks are just simple 1’s and 0’s but the challenge is combining the simple blocks to create complicated
digital systems.
Logic and Circuit Design is divided in 3 categories:
1. Number Systems in Digital System (Focuses in Binary)
2. Combinational Logic Circuit Design
3. Sequential Logic Circuit Design
Number Systems
Digital system uses more than one number system. It has the following components:
1. Unit and Number - Unit is single object (i.e., an apple) and number is a symbol that represent a unit or
quantity.
2. Base (Radix) - It is the number of symbols used in number system. Any systems is always expressed in
decimal numbers. Decimal is base (radix) 10 which means it has 10 symbols (0 to 9). The base is
indicated as subscript of the following number example
91212 1234 20𝐴16
Note that the highest value symbol in a number system is always one less than the base of the system. In
digital system the most common number system other than decimal (base-10) are:
● Binary - uses 2 digits (the binary digits or bits)
● Octal - uses 8 digits (0 to 7)
● Hexadecimal - uses 0 to 9 digits and letters A to F, where A is equal to 10 until F which is equal
to 15.
Number-Base Conversions
Decimal-Binary
Divide the decimal by 2 to get the binary equivalent. The remainder denoted by 𝑎𝑛, which is
either 0 or 1, will be the coefficient of the binary number. Continue the division process until the integer
quotient becomes 0. Write the coefficients in descending subscript order.
Example: 1110 𝑡𝑜 𝐵𝑖𝑛𝑎𝑟𝑦
Decimal-octal
Same as decimal-binary but divide by 8 instead of 2.
Example: 15310 𝑡𝑜 𝑂𝑐𝑡𝑎𝑙
Binary-Octal
First is to part it in groups of 3, starting from 𝑎0 then proceeding to the left 𝑎 , but if fraction
𝑖
proceed to the right and 𝑎 . each group of 3 digits is equivalent to a single octal digit
−𝑖
Example: 10110001101011. 1111000001102 to octal
Octal 2 6 1 5 3 . 7 4 0 6
Binary-Hexadecimal
Converting from binary to hexadecimal is like the binary-octal conversion, except the number is
partitioned into groups of four. The hexadecimal equivalent of the example below would be 2C6B. 𝐹216
Octal 2 C 6 B . F 2
Octal-Binary/Octal-Hexadecimal
Each octal digit is converted to its three-digit binary equivalent, and each hexadecimal digit is
converted to its four-digit binary equivalent.
Example:
1. 673. 1248 = 1 1011 1011. 0010 1010 02
2. 306. 𝐷16 = 0011 0000 0110. 11012
Binary Addition and Subtraction
Digital Systems are made primarily of electronic components. These components function according to
the presence, or absence, of electrical signals (i.e., Voltage or Current). Electrical Signals in modern signal digital
systems use only 2 discrete values: high (1) and low (0).
Even if other number systems are shorter than binary it is used in digital systems. PC, Phones, and other
electronic gadgets use binary that manipulates discrete elements of information which requires components that
will perform information or data processing, these components examples are processors or microprocessors. Most
Processors have similar components: parts doing computations and logical operations (arithmetic and logic unit,
or ALU), parts that fetch and execute instructions (Control Unit)< and parts that serve as immediate information
storage (Memory Unit).
Understanding these parts is crucial for designing and creating digital systems
Binary Arithmetic
Arithmetic operations in digital systems are usually done in binary because it is easier and faster than
decimals, binary is good because in logic gates we use true or false which can be represented by High,1’s and
Low,0’s.
Binary Arithmetic is carried out in a similar manner as decimal, but easier.
Binary Addition
Like in decimal addition, if the sum of 2 numbers
cannot be expressed as a single digit, carry-ing 1 to the next
column is done.
Example:0111 + 0101
In this case, the most significant (or MSB, the leftmost position; the rightmost bit is the least significant,
or LSB) bit is discarded, making the sum “clipped” which gives incorrect output.
If 5-bits is used all sum would have been accommodated and sum is correct.
Sign/Magnitude Numbers
It is good for human readability because of representation. Negative numbers are written with a minus
sign, followed by magnitude. Positive numbers can either have or not have signs preceding the magnitude.
Signed binary digit uses MSB to signify sign, the rest of the bits are for magnitude. 0 for positive and 1
for negative.
− 2 + 1 𝑖𝑠 𝑖𝑛𝑑𝑒𝑒𝑑 𝑒𝑞𝑢𝑎𝑙 𝑡𝑜 − 1
The other six unused combinations have no meaning and should be avoided.
Binary Coded Decimal (BCD), 2421, and 8,4-2,1 are examples of weighted code. Weighted
Code has each bit position assigned a weight factor in such a way that each digit can be evaluated by
adding the weights of all the 1’s in the combination.
BCD adders (Hardware) add BCD values directly, digit by digit, without converting the numbers
to binary. However, it is necessary to add 6 to the result if it is greater than 9. BCD adders require
significantly more hardware.
The 2421 and the Excess-3 (also written as XS-3) codes are examples of self-complementing
code. Such codes have the property that the 9’s complement of a decimal number is obtained directly by
changing 1’s to 0’s and 0’s to 1’s.
The 9’s complement is a diminished radix complement which is obtained by subtracting each
decimal digit from 9. For example, the 9’s complement of 12310 is 876. The binary equivalent of a
diminished radix complement is the 1’s complement. It can be obtained by simply flipping all the bits.
For example, the decimal 395 is represented in excess-3 code as 0110 1100 1000. The 9’s
complement of 395 is 604 and is represented in excess-3 code as 1001 0011 0111. Notice that simply
flipping the bits of the excess-3 equivalent of 395 gives us the excess-3 equivalent of 604.
Gray Code
The output data of many physical systems are quantities that are continuous.
These data must be converted to digital form before they can be used in a digital
system. Continuous or analog information is converted to digital form by means of
an analog-to-digital converter. It is sometimes convenient to use the Gray code to
represent digital information that has been converted from analog. The advantage
of Gray code over the ordinary binary sequence is that only one bit in the code
group changes in going from one number to the net. The Gray code is
non-weighted like the XS-3 code.
Module 2: Binary Logic and Logic Gates
Binary Logic
It deals with variables that take on 2 discrete values and operations that assume logical meaning.
Two values can be represented by bits (1’s and 0’s). It consists of binary variables and some logical
operators/ the Varoan;es are designated by letters of the alphabet, with each variable having 2 and only 2
distinct possible values: 1 and 0. Basic Logical Operations are AND, OR, and NOT which has a result
in one binary value.
The output and input relationship can be represented by a truth table or boolean equation. Truth
Table is a list of possible inputs on the left and corresponding output on the right. A Boolean Equation is
a mathematical expression using binary variables.
Logic Gates
These are electronic circuits that operate on one or more input signals producing one output
signal. Electrical signals like voltages or current as analog signals having values over given continuous
range but in digital systems voltages are interpreted as 0 or 1.
The input terminals of digital circuits accept binary signals within the allowable range and
respond at the output terminals with binary signals that fall within specified range. The intermediate
region between the allowed regions is crossed only during a state transition.
4
Other Logic Games
Buffer is a one input logic gate. It copies the input to the output. In Logical POV, it is
similar to the wire but in analog POV it can have desirable characteristics like delivering large
amounts of current to the motor or quickly sending its output to many gates due to this
abstraction is important, because without it it is very hard to show.
The triangle is the buffer and the circle is called “Bubble” and indicates that the output of
the operation is inverted before leaving the logic gate, as seen in the NOT gate symbol.
Special Gates
The Exclusive-OR (XOR) gate is true if x or y, but not both, are TRUE. any gate can be
followed by Bubble to invert its operation.
The NOT-AND (NAND) gate is AND but the output is inverted, its output is TRUE
unless both inputs are TRUE.
The NOT-OR (NOR) gate is AND but the output is inverted, its output is TRUE if
neither x nor y is TRUE.
N-input XOR gate is can be called parity gate and produces a TRUE output if an odd
number of inputs are TRUE
The Exclusive-NOT OR (XNOR) gate is inverse of XOR; its output is TRUE if both
inputs are the same (T-T or F-F). two inputs XNOR gate is called an equality gate because the
outputs are TRUE if both inputs are equal.
Combinational Circuits
It is an application of multiple logic gates. It is used to immediately gain the output
without solving for each gate. To get the output, the inputs of every logic gate are considered and
evaluate individual outputs until the last gate which will determine the final output.
The above examples show the variables and operations involved. The final output is a
Boolean Expression. By tracing the signals from the input to output which can be done through
the truth table.
𝑛
With 3 inputs variables, by using 2 where n is the number of input variables the number
3
of combinations can be determined. With this configuration 𝑛 = 3, hence 2 = 8 possible
combinations.
The x, y, and z is the input and the f is the output. As the inputs go through logic gates it
will give the f output. Which shows:
The truth table shows that OR gate is the first gate and then proceeding to AND gate.
Module 3: Boolean Algebra
Boolean Algebra
It is part of mathematics that deals with operations involving logical elements, variables and
operators, and also axioms and postulates. Named after George Boole, English Mathematician, Logical,
and Philosopher.
In digital design, it forms part of the core concepts for simplifying logic circuits.
Basic Theorems and Properties of Boolean Algebra:
Postulate 1: Closure
a. The structure is closed with respect to the operator, +. When Performing OR Operation
on 2 elements from the boolean algebraic structure, the result will also be an element of
the same structure. In simpler terms, if you take any two elements (0 or 1) and apply
the OR operation to them, the result will always be either 0 or 1, which are also
elements of the Boolean algebra.
b. The structure is closed with respect to the operator, ・, *, nothing at all. When
performing AND operation on 2 elements the result will also be an element of the same
Structure. In simpler terms, if you take any two elements (0 or 1) and apply the AND
operation to them, the result will always be either 0 or 1, which are also elements of the
Boolean algebra.
Postulate 2: Identity
a. 𝑥 + 0 = 𝑥
b. 𝑥 * 1 = 𝑥
Postulate 5: Complement
a. 𝑥 + 𝑥' = 1 - This states that when OR operation (+) is performed between “x” and
“~x”, the result is always 1. It is because one of them is always true or 1.
b. 𝑥 * 𝑥' = 0 - This states that when AND operation (* or nothing at all) is performed
between x and and complement of x, ~x or x’, the result is always 0 it is because one of
them is always 0 and x*0 = 0.
Statement: Justification
𝑥 + 𝑥 = (𝑥 + 𝑥) * 1 Postulate 2(b)
= (𝑥 + 𝑥)(𝑥 + 𝑥') Postulate 5(a)
= 𝑥 + 𝑥𝑥' Postulate 4(b)
=𝑥+0 Postulate 5(b)
𝑥=𝑥 Postulate 2(a)
Theorem 1(b): 𝑥𝑥 = 𝑥
Statement: Justification
𝑥𝑥 = 𝑥𝑥 + 0 Postulate 2(a)
= 𝑥𝑥 + 𝑥𝑥' Postulate 5(b)
= 𝑥(𝑥 + 𝑥') Postulate 4(a)
= 𝑥*1 Postulate 5(a)
=𝑥 Postulate 2(b)
Boolean Functions
An Algebraic Expression consisting of binary variables, logic operations and the
constants 0 and 1.
Given Binary Variables, each with a specific value, the output of the function is either 1
or 0.
Boolean function can be represented in 3 ways: Truth Table, Algebraic Expression,
Illustrated Logic Circuit Diagram. The Diagram is an example of a combinational Circuit which
is composed of interconnected logic gates which can have Truth Tables and Boolean Expression.
Boolean Function can have 1 truth table but can have more equivalent algebraic expression and
circuit diagram
Example:
Function 𝑓 = 𝑥'𝑦'𝑧 + 𝑥'𝑦𝑧 + 𝑥𝑦' has 3 terms and 8 literals, its diagram
representation is:
The Diagram has been reduced but still has equal results. This is good for minimizing the
equipment needed when building an Integrated Circuits.
Consensus Theorem
Some Boolean expressions are not so easily simplified. This is redundant and can be
eliminated for simpler expression. Example is 𝑥𝑦 + 𝑥'𝑧 + 𝑦𝑧 The term yz is the consensus
term. AND (𝑥 + 𝑥')to the consensus term to eliminate it. Algebraic manipulation results in the
simplified expression: 𝑥𝑦 + 𝑥'𝑧
Complement of a Function
The function is complemented if 𝑓 = 1 changes to 0 and vice versa. A complemented
function 𝑓 is denoted by 𝑓'. It can be done by putting an inverter as a last gate. Algebraically, it is
not limited to complement the entire expression. Using DeMorgan’s Theorem enables
incorporating simplification with complemented functions.
Example: find the complement of a)𝐹1 = 𝑥'𝑦𝑧' + 𝑥'𝑦'𝑧 and b)𝐹2 = 𝑥(𝑦'𝑧' + 𝑦𝑧)
a. 𝐹1' = (𝑥'𝑦𝑧' + 𝑥'𝑦'𝑧)' b. 𝐹2' = (𝑥(𝑦'𝑧' + 𝑦𝑧))'
= (𝑥'𝑦𝑧')'(𝑥'𝑦'𝑧)' = 𝑥' + (𝑦'𝑧' + 𝑦𝑧)
= (𝑥 + 𝑦' + 𝑧)(𝑥 + 𝑦 + 𝑧') = 𝑥' + [(𝑦'𝑧')'(𝑦𝑧)']'
𝑥' + (𝑦 + 𝑧)(𝑦' + 𝑧')
It is also possible to obtain the complement of a function by taking the duals and simply
complementing each literal which is easier but confusing on where parentheses are concerned.
The trick is to keep track of which variables are grouped together.
Module 4: Boolean Function and their Forms
Canonical Forms
It is easy to recognize due to the terms having all the variables (complimented or
uncomplemented) present. Example, the Boolean function of 3 variables
𝑦 = 𝑎'𝑏𝑐 + 𝑎𝑏𝑐 + 𝑎'𝑐'𝑏
Is in canonical form. The same can be said for the function of two variables
𝑧 = (𝑎 + 𝑏)(𝑎' + 𝑏')
Minterms and Maxterms
Product or Implicant is a boolean term composed of one or more literals joined by an
AND operation. Minterm is a product term that will produce 1 in all combinations of variables.
If 3 variables 001 then to produce 1 it should be 𝑥'𝑦'𝑧, x and y are complemented to turn 0 into 1.
It is identified by lowercase “m” or 𝑚𝑖 where "𝑖" is the decimal equivalent of a binary number
𝑛
representing minterms. BONUS: to get the possible 𝑖 you need the formula 2 − 1, where 𝑛 is
the number of variables.
Sum of the Products or Sum of the Minterms is the product of the variable
combinations (complemented or non-complemented) then add all of the products.
Example: Express the Boolean Function 𝐹 = 𝐴 + 𝐵'𝐶 as sum of the minterms (SOM) or SOP
The Function has 3 variables 𝐴 𝐵 𝑎𝑛𝑑 𝐶. The 1st term is missing 2 variables and the 2nd
is only 1. If it is not in SOM form, terms that are missing can be determined in each term. The
term with the missing variable is ANDed, one at a time, with the sum of the missing variable and
its complement.
In the example in the 1st term, A is missing both B and C hence A is ANDed with
(𝐵 + 𝐵') to get 𝐴𝐵 + 𝐴𝐵',and then AND (𝐴𝐵 + 𝐴𝐵') to (𝐶 + 𝐶') to get the expression
𝐴𝐵𝐶 + 𝐴𝐵𝐶' + 𝐴𝐵'𝐶 + 𝐴𝐵'𝐶'.
In the 2nd term, B’C only missing A, so (𝐵'𝐶) is ANDed to (𝐴 + 𝐴') by doing so it will
result in 𝐴𝐵'𝐶 + 𝐴'𝐵'𝐶.
Now putting all together then removing the duplicates will shows
𝐹 = 𝐴'𝐵'𝐶 + 𝐴𝐵'𝐶' + 𝐴𝐵'𝐶 + 𝐴𝐵𝐶' + 𝐴𝐵𝐶. This is equivalent of 3 variable minterms:
𝑚1 + 𝑚4 + 𝑚5 + 𝑚6 + 𝑚7
The Function can also be represented in a handier notation. By using the decimal
subscript of each minterm and indicate that it is a sum of minterms with the ∑ symbol.
𝐹(𝐴, 𝐵, 𝐶) = ∑(1, 4, 5, 6, 7)
The terms of the boolean function can be taken alternatively by using the truth table of the
function directly. It can be done by constructing the truth table with 3 variable first, and assign 1
to all minterm combination where 𝐴 = 1 𝑎𝑛𝑑/𝑜𝑟 𝐵 = 0 𝑎𝑛𝑑 𝐶 = 1. Thus,
The minterms and maxterms complement each other. 1’s is only needed to get the
minterms and 0’s are the maxterms.