Week 1
Objective:
1. To understand number systems
Number Systems
Decimal System
The Decimal system is what you use everyday when you count/ Its name is derived from
the Latin word Decem, which means ten. This makes sense since the system uses ten
digits: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. These digits are what we call the symbols of the
decimal system.
Since we have ten symbols, we can count from 0 to 9. Note that 0, even though it often
means 'nothing', is a symbol that counts! After all, you need a numeric way to say
'nothing'. When you want to count past what your simple symbols will allow, you
combine multiple digits. The table below shows this concept, which is demonstrated by
adding one for every step:
0 1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29
The table has 10 numbers across, which is the same number of symbols as the decimal
system. As you look at row 2, you notice that we added symbol 1 to the 0, making 10. In
row 3, the one is replaced by a 2, giving 20. The further you go down the table, the higher
the numbers get.
Binary Number System
Binary is a number system used by digital devices like computers, cd players, etc. Binary
is Base 2 unlike our counting system decimal which is Base 10 (denary). In other words,
Binary has only 2 different numerals (0 and 1), unlike Decimal which has 10 numerals
(0,1,2,3,4,5,6,7,8 and 9). Here is an example of a binary number: 10011100
As you can see it is simply a bunch of zeroes and ones, there are 8 numerals in all which
make this an 8 bit binary number, bit is short for Binary Digit, and each numeral is
classed as a bit.
The bit on the far right (in this case a zero) is known as the Least significant bit (LSB),
and the bit on the far left (in this case a 1) is known as the Most significant bit (MSB)
When writing binary numbers you will need to signify that the number is binary (base 2),
for example take the value 101, as it is written it would be hard to work out whether it is
a binary or decimal (denary) value, to get around this problem it is common to denote the
base to which the number belongs by writing the base value with the number, for
example:
1012 is a binary number and 10110 is a decimal (denary) value.
Octal Number System
Although this was once a popular number base, especially in the Digital Equipment
Corporation PDP/8 and other old computer systems, it is rarely used today. The Octal
system is based on the binary system with a 3-bit boundary. The Octal Number System:
Uses base 8
Includes only the digits 0 through 7 (any other digit would make the number an
invalid octal number)
The weighted values for each position are as follows:
85 84 83 82 81 80
32768 4096 512 64 8 1
Hexadecimal Number System
Binary is an effective number system for computers because it is easy to implement with
digital electronics. It is inefficient for humans to use binary, however, because it requires
so many digits to represent a number. The number 76, for example, takes only two digits
to write in decimal, yet takes seven digits to write in binary (1001100). To overcome this
limitation, the hexadecimal number system was developed. Hexadecimal is more compact
than binary but is still based on the digital nature of computers.
Hexadecimal works in the same way as binary and decimal, but it uses sixteen digits
instead of two or ten. Since the western alphabet contains only ten digits, hexadecimal
uses the letters A-F to represent the digits ten through fifteen. Here are the digits used in
hexadecimal and their equivalents in binary and decimal:
Hex 0 1 2 3 4 5 6 7 8 9 A B C D E F
Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Binary 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Week 2
Objective:
1. Understand Number Systems
2. Conversion from Binary to Decimal & Decimal to Binary
3. Conversion from Binary to Octal & Octal to Binary
4. Conversion from Binary to Hexadecimal & Hexadecimal to
Binary
1 Binary to Decimal & Decimal to Binary
1.1 Binary to Decimal Conversion
1.2 Decimal to Binary Conversion
To convert a decimal number to binary, first subtract the largest possible power of two,
and keep subtracting the next largest possible power form the remainder, marking 1st in
each column where this is possible and 0s where it is not.
Example 1 - (Convert Decimal 44 to Binary)
Example 2 - (Convert Decimal 15 to Binary)
Example 3 - (Convert Decimal 62 to Binary)
Decimal Values and Binary Equivalents chart:
DECIMAL BINARY
1 1
2 10
3 11
4 100
5 101
6 110
7 111
8 1000
9 1001
10 1010
16 10000
32 100000
64 1000000
100 1100100
256 100000000
512 1000000000
1000 1111110100
1024 10000000000
1.3 Binary to Octal & Octal to Binary
The following table show Octal numbers and their Binary Equivalent
Octal Binary
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
1.4 Binary to Octal Conversion
It is easy to convert from an integer binary number to octal. This is accomplished by:
1. Break the binary number into 3-bit sections from the LSB to the MSB.
2. Convert the 3-bit binary number to its octal equivalent.
For example, the binary value 1010111110110010 will be written:
001 010 111 110 110 010
1 2 7 6 6 2
1.5 Octal to Binary Conversion
It is also easy to convert from an integer octal number to binary. This is accomplished by:
1. Convert the decimal number to its 3-bit binary equivalent.
2. Combine the 3-bit sections by removing the spaces.
For example, the octal value 127662 will be written:
1 2 7 6 6 2
001 010 111 110 110 010
This yields the binary number 001010111110110010 or 00 1010 1111 1011 0010 in more
readable format.
1.6 Binary to HEX & HEX to Binary
Using this relationship, you can easily convert binary numbers to hex. Starting at the
radix point and moving either right or left, break the number into groups of four. The
grouping of binary into four bit groups is called binary-coded hexadecimal (BCH).
Convert 111010011 to hex:
2
Add 0s to the left of the MSD of the whole portion of the number and to the right of the
LSD of the fractional part to form a group of four. Convert .111 to hex:
2
Convert .111 to hex:
2
In this case, if a 0 had not been added, the conversion would have been .7 , which is
16
incorrect.
Convert the following binary numbers to hex:
Q1. 102
Q2. 10112
Q3. 1011112
Q4. 00112
Q5. 110011
Week 3
Objective:
1. Binary Coded Decimal
2. Excess-Three Code
3. Seven Segment Display Code
Binary Coded Decimal
Binary-coded decimal (BCD) is an encoding for decimal numbers in which each digit is
represented by its own binary sequence. Its main virtue is that it allows easy conversion
to decimal digits for printing or display and faster decimal calculations. Its drawbacks are
the increased complexity of circuits needed to implement mathematical operations and a
relatively inefficient encoding—it occupies more space than a pure binary representation.
In BCD, a digit is usually represented by four bits which, in general, represent the
values/digits/characters 0-9. Other bit combinations are sometimes used for sign or other
indications.
Excess-three Code:
A number code in which the decimal digit n is represented by the four-bit binary
equivalent of n + 3.
Excess-3 binary coded decimal (XS-3), also called biased representation or Excess-N, is
a numeral system that uses a pre-specified number N as a biasing value. It is a way to
represent values with a balanced number of positive and negative numbers. In XS-3,
numbers are represented as decimal digits, and each digit is represented by four bits as
the BCD value plus 3 (the "excess" amount):
• The smallest binary number represents the smallest value. (i.e. 0 - Excess Value)
• The greatest binary number represents the largest value. (i.e. 2N - Excess Value -
1)
Decimal Binary Decimal Binary Decimal Binary Decimal Binary
-3 0000 1 0100 5 1000 9 1100
-2 0001 2 0101 6 1001 10 1101
-1 0010 3 0110 7 1010 11 1110
0 0011 4 0111 8 1011 12 1111
To encode a number such as 127, then, one simply encodes each of the decimal digits as
above, giving (0100, 0101, 1010).
The primary advantage of XS-3 coding over BCD coding is that a decimal number can be
nines' complemented (for subtraction) as easily as a binary number can be ones'
complemented; just invert all bits.
Adding Excess-3 works on a different algorithm than BCD coding or regular binary
numbers. When you add two XS-3 numbers together, the result is not an XS-3 number.
For instance, when you add 1 and 0 in XS-3 the answer seems to be 4 instead of 1. In
order to correct this problem, when you are finished adding each digit, you have to
subtract 3 (binary 11) if the digit is less than decimal 10 and add three if the number is
greater than or equal to decimal 10.
Seven Segment Display Code:
Binary numbers are necessary, but very hard to read or interpret. A seven-segment (LED)
display is used to display binary to decimal information.
A seven-segment display may have 7, 8, or 9 leads on the chip. Usually leads 8 and 9 are
decimal points. The figure below is a typical component and pin layout for a seven
segment display.
The light emitting diodes in a seven-segment display are arranged in the figure below.
The image below is your typical seven segment display with each of the segments labeled
with the letters A through G. To display digits on these displays you turn on some of the
LEDs. For example, when you illuminate segments B and C for example your eye
perceives it as looking like the number "1." Light up A, B, and C and you will see what
looks like a "7."
Week 4
Objective:
1. Know the fundamentals of Boolean Algebra
2. Understand Boolean Postulates
3. Minimize Logical expressions algebraically.
Boolean Postulates
Introduction
The most obvious way to simplify Boolean expressions is to manipulate them in the same
way as normal algebraic expressions are manipulated. With regards to logic relations in
digital forms, a set of rules for symbolic manipulation is needed in order to solve for the
unknowns.
A set of rules formulated by the English mathematician George Boole describe certain
propositions whose outcome would be either true or false. With regard to digital logic,
these rules are used to describe circuits whose state can be either, 1 (true) or 0 (false). In
order to fully understand this, the relation between the AND gate, OR gate and NOT gate
operations should be appreciated. A number of rules can be derived from these relations
as Table 1 demonstrates.
• P1: X = 0 or X = 1
• P2: 0 . 0 = 0
• P3: 1 + 1 = 1
• P4: 0 + 0 = 0
• P5: 1 . 1 = 1
• P6: 1 . 0 = 0 . 1 = 0
• P7: 1 + 0 = 0 + 1 = 1
Table 1: Boolean Postulates
Laws of Boolean Algebra
Table 2 shows the basic Boolean laws. Note that every law has two expressions, (a) and
(b). This is known as duality. These are obtained by changing every AND(.) to OR(+),
every OR(+) to AND(.) and all 1's to 0's and vice-versa.
It has become conventional to drop the . (AND symbol) i.e. A.B is written as AB.
Commutative Law
(a) A + B = B + A
(b) A B = B A
Associate Law
(a) (A + B) + C = A + (B + C)
(b) (A B) C = A (B C)
Distributive Law
(a) A (B + C) = A B + A C
(b) A + (B C) = (A + B) (A + C)
Identity Law
(a) A + A = A
(b) A A = A
(a)
(b)
Redundance Law
(a) A + A B = A
(b) A (A + B) = A
(a) 0 + A = A
(b) 0 A = 0
(a) 1 + A = 1
(b) 1 A = A
(a)
(b)
(a)
(b)
De Morgan's Theorem
De Morgan's theorem are rules in formal logic relating pairs of dual logical operators in a
systematic manner expressed in terms of negation. The relationship so induced is called
De Morgan duality.
not (P and Q) = (not P) or (not Q)
not (P or Q) = (not P) and (not Q)
De Morgan's laws are based on the equivalent truth-values of each pair of statements.
(a)
(b)
Minimize Logic Expressions Algebraically
Using the laws given above, complicated expressions can be simplified.
Week 5
Objective:
1. Know the fundamentals of Boolean Algebra.
2. Understand Boolean Algebra Manipulation.
3. Using Boolean Postulates to minimize Logic equations.
Basic Digital Logic
There are three major functions in Digital Electronics. These functions are used to make
more complicated circuits, so an understanding of how these building blocks work is key
to understanding how circuits work.
The "AND" function requires that multiple inputs are all true for the output to be true.
For example, if you turn your car's ignition key, and step on the gas, then your car will
start. Simply turning the key or stepping on the gas isn't enough, both must be done to get
the correct output. Likewise, all the inputs into an AND gate must be true for the output
to be true.
The "OR" function requires any input to be true for the output to be true. For example,
you can enter your home through either the back door or front door. Once you enter
either one, you are inside your home. Likewise, at least one of the inputs into an OR gate
must be true for the output to be true. If more then one input is true, the output is still
true, since the minimum requirement is one.
The "INVERTER" function (also known as the "NOT") simply changes the condition. If
it was true it becomes false, and if it was false it becomes true. For example, it is never
day and night at the same time. If it is day, it is not night. Likewise, an INVERTER gate
will logically change the input. For the output to be true, the input must be false.
In digital electronics, a false condition is 0 volts (called VSS), while a true condition is
the applied voltage (called VCC or VDD). Since the applied voltage can range from
under 3 volts to 5 volts, the true condition is normally simply called a logical 1, and the
false condition is called a logical 0.
Using this information, it is possible to create what is called a "truth table." A truth table
lists each possible input combination, and the resulting output for each combination.
While the AND and the OR functions can each have two or more inputs, the truth table
given here will assume two inputs.
AND OR INV
#1 #2 O #1 #2 O I O
------- ------- ---
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1
To read this table, read across. For example, look at the third line down. If input #1 is a
logical 1 while input #2 is a logical 0, the output of an AND gate is a logical 0. On the
other hand, the same inputs into an OR gate will generate a logical 1 output. Remember
that for an AND gate all inputs must be true (input #1 AND input #2) to get a true output.
However, for an OR gate only one must be true (input #1 OR input #2) to get a true
output.
Basic Boolean Algebra Manipulation
Boolean Algebra equations can be manipulated by following a few basic rules.
Manipulation Rules
A + B = B + A
A * B = B * A
(A + B) + C = A + (B + C)
(A * B) * C = A * (B * C)
A * (B + C) = (A * B) + (A * C)
A + (B * C) = (A + B) * (A + C)
Equivalence Rules
=
A = A (double negative)
A + A = A
A * A = A
_
A * A = 0
_
A + A = 1
Rules with Logical Constants
0 + A = A
1 + A = 1
0 * A = 0
1 * A = A
Many of these look identical to Matrix Operations in Linear Algebra. At any rate, this
permits a circuit designer to create a circuit as it comes to their mind, then manipulate the
formula to generate an equivalent circuit that does the same thing but requires less space.
This can be illustrated using the 5th manipulation rule.
Using the rule, generating an equivalent circuit that does the exact same thing, but be less
complicated, can be done with reasonable ease.
In the case of CMOS, the right hand side of the formula can also be manipulated, just
always remember to invert. The manipulation occurs under the invert bar.
_________________
D = (A * B) + (A * C)
is the same as...
___________
D = A * (B + C)
The manipulation is done the exact same way. Once there is a simplified formula, using
the rules with logical constants permit the placement of values directly into the formula to
see what the answer is. For example, using the above non inverted formula, C is a logical
1.
D = A * (B + C)
D = A * (B + 1)
D = A * (1) [1 + A = 1]
D = A [1 * A = A]
If C is known to be a logical 1, anything OR logical 1 is always a logical 1. Since the
minimum requirement is one input, once a single input is true (in this case C), the other
inputs don't alter the result. On the other hand, the AND gate requires all inputs. With
B+C true, the only other requirement is A. As the formula gave, D will be whatever A is.
Many Boolean Algebra problems can be solved using more then one formula, just like
most Algebra problems. For example...
___________
D = A * (B + C) [given formula]
_ _______ _______ _ _
D = A + (B + C) [DeMorgan (A * B) = A + B]
_ _ _ _______ _ _
D = A + (B * C) [DeMorgan (A + B) = A * B]
_ _ _ _
D = (A + B) * (A + C)
[A + (B * C) = (A + B) * (A + C)]
_______ _______ _______ _ _
D = (A * B) * (A * C) [DeMorgan (A * B) = A + B]
_________________ _______ _ _
D = (A * B) + (A * C) [DeMorgan (A + B) = A * B]
Manipulation rule number 5 could have been used to go from the first step to the last one
in a single move. However, using DeMorgan's Theorem, the problem turns into
something that manipulation rule number 6 can then be used on instead. DeMorgan's
Theorem changes the logic of the formula.