Professional Documents
Culture Documents
Systems
EE 180
LOGIC IN CPU
Register Section
Arithmetic Logic Unit (ALU)
Control Unit
Register Section
Basic Microprocessor Registers
Instruction Register (IR). The instruction
register stores instructions. The contents of an
instruction register are always decoded by the
microprocessor as an instruction. A l6-bit
microprocessor has a 16-bit instruction register.
Program Counter (PC). The program counter
contains the address of the instruction or operation
code (op-code). The program counter normally
contains the address of the next instruction to be
executed. It is basically the queuing system for the
op-code.
accumulator-based or
a general-purpose register-based
machine.
In an accumulator-based microprocessor such as the
Carry flag
The carryflag is used to reflect whether or not
Zero flag
is used to show whether the result of an
Parity Flag
A parity flag is set to 1 to indicate whether
Sign Flag
The sign flag (also sometimes called the
Overflow Flag
the overflow flag arises from the
Review
Determine the carry (C), sign (S), zero (Z),
Review
Determine the carry (C), sign (S), zero (Z),
Control Unit
The main purpose of the control unit is to read
RESET
This input is common to all microprocessors.
READ/WRITE
This output line is common to all
READY
This is an input to the microprocessor. Slow
Challenge
There is a control signal named R/W.
Q1:
ALU
Responsible to perform the operation in the
computer.
Basic operations are implemented in hardware
level.
Two types of operations:
Arithmetic operations
Addition, subtraction, multiplication and division.
Logical operations
OR, AND, NOT & EX-OR.
Binary Adder :
Binary adder is used to add two binary numbers.
In general, the adder circuit needs two binary inputs and two binary
outputs. The input variables designate the augends and addend bits;
The output variables produce the sum and carry.
The binary addition operation of single bit is shown in the truth table
C: Carry Bit
S: Sum Bit
Full Adder:
A full adder is a combinational circuit that forms the arithmetic sum
of three bits. It consists of three inputs and two outputs.
Two of the input variables, denoted by x and y, represent the two
bits to be added. The third input Z, represents the carry from the
previous lower position.
The two outputs are designated by the symbols S for sum and C for
carry.
To get the four bit adder, we have to use 4 full adder block. The carry
output the lower bit is used as a carry input to the next higher bit.
The circuit of 4-bit adder shown in the Figure
If
M=o
then
A+B
Multiplication
Multiplication of binary numbers is performed
Multiplication
Multiplication of two numbers in binary representation can be performed
by a process of SHIFT and ADD operations. Since the binary number
system allows only 0 and 1's, the digit multiplication can be replaced by
SHIFT and ADD operation only, because multiplying by 1 gives the
number itself and multiplying by 0 produces 0 only.
The multiplication process is illustrated with a numerical example.
Steps
Memory
A memory unit stores both data and instructions.
External Memory
Removable media:
Storage for data that is not always needed
and doesnt have to be kept in the computer.
CD and Magnetic Disks are examples.
External Memory
Magnetic Disk:
This is bulk storage device.
For permanent storage, we use magnetic
disk.
The storage capacity is very high.
Internal Memory
Main Memory:
Slower memory.
Information have to be brought(whether it is
data or program) to main memory before
going to CPU.
CPU can work with the information available
in main memory only.
Internal Memory
Cache Memory:
Placed in between CPU and main memory.
Faster than main memory.
Big volume of cache memory is not
advisable due cost and constraints in the
CPU.
Internal Memory
Registers:
Part of CPU
Information from main memory is brought to
CPU and kept in register.
Limited number of registers due to space
and cost constraints
Faster storage devices.
RAM
ROM
PROM
EPROM
EEPROM
Input Unit
data from
outside can be supplied to the computer.
Program or data is read into main storage
from input device or secondary storage under
the control of CPU input instruction.
Output Unit
With the help of output unit computer results