Computer Fundamentals and Logic Circuits Part 2 Updated
Computer Fundamentals and Logic Circuits Part 2 Updated
CPU CHIP
Main Parts of the CPU
Control Unit
• Contains circuitry that uses electrical signals to direct the entire computer system
to carry out, or execute, stored program instructions
• Communicate with both the Arithmetic Logic Unit and the memory
Arithmetic Logic Unit
• Contains circuitry that executes arithmetic and logical operations
• Mathematically, it can perform addition, subtraction, multiplication, and division
• Logically, it is used in comparison
• The computer can take an action based on the results of the comparison
Cache
Relatively small amount of very fast memory that stores data and
instructions that are used frequently resulting in an improved
processing speed
Parts of the Computer System
e. Miscellaneous Parts
Motherboard
• The main board of the computer
• Manage all transactions of data between CPU and
peripherals
• Houses the CPU and the second level cache, the chipset,
the BIOS, main memory, I/O chips, ports for the keyboard,
serial I/O, parallel I/O, disks and plug-in cards
Power Supply
• Convert High Voltage AC to a lower DC voltage to power
up the computer’s electronic components
• +5V supplies electronic circuits on motherboards, adaptor
cards and peripheral devices
• +12V is used mainly to power motors of disk device
systems such as hard disk, CD-ROM and floppy disk drive
Modems
• Allows transfer if data over standard telephone wires
with other computer users
Parts of the Computer System
Subtraction
Multiplication
1011 Multiplicand
101 Multiplier 110111
Number Base Conversion
A number expressed in base r can be converted to its decimal
equivalent by multiplying each coefficient with the corresponding
power of r and adding
Examples
1010.011 to decimal
Binary to Octal
010 110 001 101 011 111 100 000 110
Binary to Hexadecimal
0010 1100 0110 1011 1111 0010
Complements
- used in digital computers for simplifying the subtraction
operations and for logical manipulations
Examples:
a. 0.3267
b. 25.639
Complements
The 9’s complement of a decimal number can be formed simply
by subtracting every digit from 9.
Examples:
a. 0.3267
b. 25.639
Complements
The 2’s complement can be formed by leaving all least significant
zeroes and the 1st non-zero unchanged and then replacing 1’s by
0’s and 0’s by 1’s in all other higher significant digits.
Examples:
a. 101100
b. 0.0110
Examples:
a. 101100
b. 0.0110
Number Systems
Binary Codes
Decimal Codes
Binary 1101
Decimal Digit BCD Excess 3
0 0000 0011
1 0001 0100
2 0010 1010
3 0011 0110
4 0100 0111
5 0101 1000
6 0110 1011
7 0111 1010
8 1000 1011
9 1001 1100
Error Detection Codes
Parity Bit – an extra bit included with a message
to make the total no. of 1’s either odd or even
Ex: 0111odd P = 0
even P = 1
Alphanumeric Codes
- binary code of a group of elements
consisting of the 10 decimal digits, the 26
letters of the alphabet and a certain number
of special symbol such as $
Number Systems
ASCII – American Standard Code for Information Interchange
Number Systems
EBCDIC – Extended Binary Coded Decimal Interchange Code
Binary Logic
- Deals with variables that take on two discrete
values and with operations that assume logical
meaning.
- consists of binary variables and logical operations.
- a logic circuit where output is high only when all inputs are
high
- interpreted to mean that z=1 if and only if x = 1 and y = 1
otherwise z = 0
Truth Table - a table that shows all input and output possibilities for a
logic circuit
X Y Z
0 0 0
0 1 0
1 0 0
1 1 1
Basic Logical Operations
2. OR (Union)
- represented by a plus sign
x+y=z
x OR y is equal to Z
= 0 then Z = 0
X Y Z
0 0 0
0 1 1
1 0 1
1 1 1
Basic Logical Operations
3. NOT (Inversion)
- represented by a prime (sometimes by a bar)
X’ = Z ( or X = Z )
“X NOT is equal to Z”
if: X = 1 then Z = 0
X = 0 then Z = 1
X Z
0 1
1 0
Logic Gates
• Electronic Digital Circuits
• Logic Circuits
• Block of hardware that produces a
Logic 1 or Logic 0 output signal if input
logic requirements are satisfied
• Digital Circuits
• Switching Circuits
Other Logic Operations
1. NOR Function
- complement of the OR function and its name is an abbreviation
of Not-OR
- all inputs be low to get a high output
X Y F
0 0 1
0 1 0
1 0 0
1 1 0
2. NAND Function
- complement of AND
- abbreviation of Not-AND
X Y F
0 0 1
0 1 1
1 0 1
1 1 0
Other Logic Operations
3. Exclusive OR (XOR or EOR)
- similar to OR but excludes the combination of both X and Y
equal to 1
X Y F
0 0 0
0 1 1
1 0 1
1 1 0
4. Equivalence or Exclusive NOR or Exclusive OR-Not
- a function that is 1 when the 2 binary variables are equal i.e.
when both are o or both are 1.
X Y F
0 0 1
0 1 0
1 0 0
1 1 1
Other Logic Operations
5. Buffer
- produces a transfer function but does not produce any
particular logic operation since the binary value of the output is equal
to the binary value of the input
X F
0 0
1 1
NOR NAND
XOR XNOR
Boolean Algebra ( Symbolic Logic)
- A set of elements, a set of operators and a number of unproved
axioms or postulates
2. X + X’ = 1 ; X . X’ = 0
3. X + X = X ;X.X=X
4. X + 1 = 1 ;X.0=0
5. (X’)’ = X Involution
6. X + Y = Y + X ; XY = YX Commutative
8. X (Y + Z) = XY + YZ ; X + YZ = (X + Y) (X + Z) Distributive
10. X + XY = X ; X (X + Y) = X Absorption
Boolean Algebra
Operator Precedence
1. Parentheses
2. NOT
3. AND
4. OR
Examples
1. X + X’Y
2. X (X’ + Y)
3. X’Y’Z + X’YZ + XY’
4. XY + X’Z + YZ
Canonical and Standard Forms
A binary variable may appear either in its normal form (x) or in its
complement form (x’)
Since each variable may appear in either form, there are four
possible combinations
Each of the 4 AND terms represents one of the distinct areas in the
Venn diagram
Minterm or Standard Product
A symbol for each minterm is of the form mj where j denotes the
decimal equivalent of the binary no. of the minterm
designated
0 0 0 x’y’z’ m0 x+y+z M0
0 0 1 x’y’z m1 x+y+z’ M1
0 1 0 x’yz’ m2 x+y’+z M2
0 1 1 x’yz m3 x+y’+z’ M3
1 0 0 xy’z’ m4 x’+y+z M4
1 0 1 xy’z m5 x’+y+z’ M5
1 1 0 xyz’ m6 x’+y’+z M6
1 1 1 xyz m7 x’+y’+z’ M7
Minterm or Standard Product
f1 = x’y’z + xy’z + xyz
f1 = m1 + m4 + m7
Example:
Express the Boolean Function, F = A + B’C as a sum of minterms.
Example:
Express the Boolean Function, F = xy + x’z in a product of
maxterms form
Conversion between Canonical Forms
The complement of a function expressed as the sum of minterms
equals the sum of minterms missing from the original
function.
Product of Sums
- A Boolean expression containing OR
terms call sum terms
Ex. F2 = x(y’+z) (x’ + y + z’ + w)
Simplification of Boolean Functions
Karnaugh Map
Sum of Products (SOP)
- may be regarded as a pictorial form of a truth table or as an extension of the
Venn Diagram
- the map is a diagram made up of squares. Each square represents one
minterm
- any 2 minterms in adjacent squares that are OR together will cause a removal
of the different variable
Notes:
1 square represents 1 minterm – 4 literals
2 adjacent squares – 3 literals
4 adjacent squares – 2 literals
8 adjacent squares – 1 literal
16 adjacent squares = 1
A 4x4 Karnaugh Map
Don’t Care Conditions
There are applications where certain
combination of input variables never
occur.
Half Adder
-2 binary inputs and 2 binary outputs
X Y C S
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
Combinational Logic Circuits
Full Adder
-a combinational circuit that forms the arithmetic sum of 3 input bits
- consists of 3 inputs and 2 outputs
X Y Z C S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
Sum: Carry:
S = x’y’z + x’yz’ +xy’z +xyz C = xy + xz + yz
Combinational Logic Circuits
Decoder
- a combinational logic circuit that recognizes the presence of
a specific binary no. or word.
The input is a multibit binary no. and the output is a signal
that indicates the presence of a specific no. of bit combination
- a combinational circuit that converts binary information
from n inputs to a maximum of 2n unique output lines
n to m lines decoders
Encoder
- a digital function that produces a reverse operation from
that of a decoder.
- a combinational logic circuit that accepts one or more
inputs and generates a unique multibit binary output. The
encoder generates a number or code in response to an
input
Combinational Logic Circuits
Multiplexer (data selector circuit)
- an electronic switch that permits any one of a number
of inputs to be chosen and routed to the output
- has 2 or more inputs and a single output
- main function is to control the routing of data from one
place to another
Demultiplexer
- a combinational logic circuit that receives
information on a single line and transmits this
information on one of 2n possible output lines
Sequential Circuits
- employ memory elements (binary cells) in
addition to logic gates
- their outputs are a function of the inputs and
the state of the memory elements
Sequential Circuits
Sequential Circuits
- employ memory elements (binary cells) in
addition to logic gates
- their outputs are a function of the inputs and
the state of the memory elements
Dynamic RAM
- uses MOSFET’s and capacitors that store data
- highly volatile because not only must the power be
kept on, but the capacitor charge must also be
refreshed every few msec
Bubble Memory
- sandwiches a thin film with magnetic material
between two permanent bias magnets
- logical 1’s and 0’s are represented by magnetic
bubbles in the thin film
Parts of the Computer System
2. Software
• Refers to all programs which can assist users of a particular type of computer to make the
best use of their machines
a. Related Terminologies
Program
• Detailed list of steps or instructions which must be followed to accomplish
a certain task
Branching
• Allows us to write one program that can do diff. things at different times
Debugging
• Running the program to detect, locate and correct mistakes (logic errors)
Desk Checking
• Mental checking or proofreading of the program before it is run
Flowchart
• Pictorial representation of the step by step solution or diagrammatic
representation of sequence of events
Loop
• A section of a program that repeats over and over again
Straight Line Program
• A program in which each step is followed by the next without any
alternate routes or paths
Subroutine
• A portion of the program which is called upon to perform a specific task
• When the task is finished, the main part of the program is returned to
Walkthrough
• Process in which a group of programmers- your peers review the program
and offers suggestions in a collegial way
Parts of the Computer System
b. Programming Languages
• Set of Rules for instructing the computer what
operations to perform
Machine Language
• Lowest level of programming language
• Represents data as 1’s and 0’s
Assembly Language
• Use letters as mnemonic codes to replace
1’s and 0’s of machine language
• Assembler program translate the assembly
language into the machine language
High Level Language
• Use advance commands
• Written in English like manner
• A compiler converts high level into
machine language
High Level Languages
1. FORTRAN
• Formula Translation
• The first high level language introduced by IBM in 1954
• Designed to execute complex formulas
2. COBOL
• Common Business Oriented Language
• Introduced in 1959 by CODASYL
• It has four divisions; identification, environment, data and
procedure
3. BASIC
• Beginner’s All Purpose Symbolic Instruction Code
• Introduced in 1965 by Dart-mouth
• Designed to be easy for non professional programmers to learn
and use
4. Pascal
• Named after French mathematician Blaise Pascal
• Developed by Nicklaus Wirth
• Designed to encourage the programmer to adhere to what is
considered as “correct” programming practice