Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
33 views41 pages

Ch2 Regitster

The document covers the internal structure and basic operations of microprocessors, focusing on components such as the Arithmetic Logic Unit (ALU), control unit, and various types of registers. It explains the functions of different registers, including general-purpose and special-purpose registers, as well as the bus system for data transfer. Additionally, it provides examples of microprocessors like Intel 8085 and 8086, detailing their specifications and historical significance.

Uploaded by

bilallatif973
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views41 pages

Ch2 Regitster

The document covers the internal structure and basic operations of microprocessors, focusing on components such as the Arithmetic Logic Unit (ALU), control unit, and various types of registers. It explains the functions of different registers, including general-purpose and special-purpose registers, as well as the bus system for data transfer. Additionally, it provides examples of microprocessors like Intel 8085 and 8086, detailing their specifications and historical significance.

Uploaded by

bilallatif973
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Lecture # 2 & 3

(Computer Organization
and Assembly Language)

BSCS 3rd
Registers
Internal structure and basic operation of
microprocessor

Address bus
ALU Register
Section
Data bus

Control and timing


section Control bus

Block diagram of a microprocessor


3/26/2025 3
Arithmetic and logic unit (ALU)
• The component that performs the arithmetic and logical
operations
• the most important components in a microprocessor, and is
typically the part of the processor that is designed first.
• able to perform the basic logical operations (AND, OR), including
the addition operation.
• The inclusion of inverters on the inputs enables the same ALU
hardware to perform the subtraction operation (adding an inverted
operand), and the operations NAND and NOR.

3/26/2025 4
Internal structure of ALU

2 bits of ALU 4 bits of ALU

3/26/2025 5
Control unit

• The circuitry that controls the flow of information through the


processor, and coordinates the activities of the other units within it.
• In a way, it is the "brain within the brain", as it controls what happens
inside the processor, which in turn controls the rest of the PC.
• On a regular processor, the control unit performs the tasks of fetching,
decoding, managing execution and then storing results.

3/26/2025 6
Internal structure of control unit

3/26/2025 7
CPU Registers
Registers are a type of computer memory used to quickly accept,
store, and transfer data and instructions that are being used
immediately by the CPU.

Register is a small high speed memory in


side cpu

Cpu contanin a number of register

Register Register size determine how much


information it can store

A register can be of 1,2,3,4 or 8 byte

Bigger the size increase the performance


Types

Registers

Special purpose General purpose


register register
General Store temporary data
purpose within the microprocessor
registers
Accumulator Register

Base Register
Types
Counter Register

Data Register
It is generally used for
arithmetical and logical
Accumulator instructions
register It is of 16 bits and is
divided into two 8-bit
registers AH and AL to
also perform 8-bit
instructions.
It is used to store the value of the offset
Base and Data Movement

Register
It is of 16 bits and is divided into two 8-
bit registers BH and BL to also perform
8-bit instructions
It is used for counting purpose
It is used in looping and rotation.
Counter
Register it is of 16 bits and is divided into two 8-
bit registers CH and CL to also perform
8-bit instructions.
It is used in multiplication an
input/output port addressing.
Data
Register It is of 16 bits and is divided into two 8-
bit registers DH and DL to also perform
8-bit instructions.
Special purpose Registers

• Special Purpose Registers Which Controls Or Monitors Various Aspects Of The


Microprocessor's Function.
• A special purpose register is one that has a specific control or data handling
task to carry out. There are a number of special purpose registers within the
CPU.
Memory Address Registers (MAR):

It holds the address of the location to be accessed from memory.

When CPU want to read or write data in memory it store the address of that
memory location in this register
Memory Buffer Registers (MbR):

MBR register is used to store the data coming from


memory or going to memory
Program Counter (PC) is used to contains
the memory address of the next instruction
to be fetched.

Program PC points to the address of the


Counter next instruction to be fetched
from the main memory when
(PC) the
theprevious
previous instruction hasbeen
instruction has
successfully
been completed
successfully completed.

Program Counter (PC) also


functions to count the number
ofofinstructions.
instructions.
Instruction Register (IR):

It is the register which holds the instruction which is currently been


executed.
A stack is set of memory locations in
which dat is stores and retrieved in an
order .

Stack
pointer This order is called last in first out (lifo).

register
Stack pointer register is used to manage
stack in computer
Register sets
• The register section/array consists completely of circuitry used to
temporarily store data or program codes until they are sent to the
ALU or to the control section or to memory.

• The number of registers are different for any particular CPU and
the more register a CPU have will result in easier programming
tasks.

• Registers are normally measured by the number of bits they can


hold, for example, an "8-bit register" or a "32-bit register".

3/26/2025 24
Register in motorola 68000 microprocessor
31 16 15 8 7 0
D0
D1
D2
D3 DATA REGISTERS
D4
D5
D6
D7
31 16 15 8 7 0
A0
A1
A2
A3 ADDRESS REGISTERS
A4
A5
A6
A7

USER STACK POINTER


A7 STACK POINTER
SUPERVISOR STACK POINTER

PC PROGRAM CONTER
15 8 7 0
SYSTEM BYTE USER VYTE SR STATUS REGISTER
3/26/2025 25
accumulator

• a register in which intermediate arithmetic and logic results are


stored.
• example for accumulator use is summing a list of numbers.
• The accumulator is initially set to zero, then each number in turn is added to
the value in the accumulator.
• Only when all numbers have been added is the result held in the accumulator
written to main memory or to another, non-accumulator, CPU register.

3/26/2025 26
Condition code register (CCR)

• an 8 bit register used to store the status of CPU, such as carry, zero,
overflow and half carry.

3/26/2025 27
Flag Name Description

Z Zero flag Indicates that the result of a mathematical or logical operation was zero.

Indicates that the result of an operation produced an answer greater than the
C Carry flag number of available bits. (This flag may also be set before a mathematical
operation as an extra operand to certain instructions, e.g. "add with carry".)

Masks the XIRQ request when set. It is set by the hardware and cleared by the
X Extend flag
software as well is set by unmaskable XIRQ.

Indicates that the result of a mathematical operation is negative. In some


processors, the N and S flags have different meanings: the S flag indicates
N Negative/ Sign flag
whether a subtraction or addition has taken place, whereas the N flag
indicates whether the last operation result is positive or negative.

Indicates that the result of an operation has overflowed according to the


V Overflow Flag
CPU's word representation, similar to the carry flag but for signed operations.

Interrupts can be enabled or disabled by respectively setting or clearing this


I interrupts flag. Modifying this flag may be restricted to programs executing in supervisor
mode

3/26/2025 28
Program counter (PC)

• a 16 bit register, used to store the next address of


the operation code to be fetched by the CPU.
• Not much use in programming, but as an indicator
to user only.
• Purpose of PC in a Microprocessor
• to store address of tos (top of stack)
• to store address of next instruction to be
executed.
• count the number of instructions.
• to store base address of the stack.
3/26/2025 29
Internal structure of PC

3/26/2025 30
Stack pointer (SP)

• The stack is configured as a data structure that


grows downward from high memory to low memory.
• At any given time, the SP holds the 16-bit address of
the next free location in the stack.
• The stack acts like any other stack when there is a
subroutine call or on an interrupt. ie. pushing the
return address on a jump, and retrieving it after the
operation is complete to come back to its original
location.

3/26/2025 31
Bus system

• a subsystem that transfers data between computer components


inside a computer or between computers.

4 PCI Express bus card slots (from top to bottom: x4, x16, x1 and x16),
compared to a traditional 32-bit PCI bus card slot (very bottom).

3/26/2025 32
Bus system connection

3/26/2025 33
Data bus
• The data bus is 'bi-directional'
• data or instruction codes from memory or
input/output.are transferred into the microprocessor
• the result of an operation or computation is sent out
from the microprocessor to the memory or
input/output.
• Depending on the particular microprocessor, the
data bus can handle 8 bit or 16 bit data.

3/26/2025 34
Address bus

• The address bus is 'unidirectional', over which the microprocessor


sends an address code to the memory or input/output.
• The size (width) of the address bus is specified by the number of bits
it can handle.
• The more bits there are in the address bus, the more memory
locations a microprocessor can access.
• A 16 bit address bus is capable of addressing 65,536 (64K) addresses.

3/26/2025 35
Control bus

• The control bus is used by the microprocessor to send out or receive


timing and control signals in order to coordinate and regulate its
operation and to communicate with other devices, i.e. memory or
input/output.
• Read command
• Acks command

3/26/2025 36
Micro processor clock

• Also called clock rate, the speed at which a microprocessor executes


instructions. Every computer contains an internal clock that regulates the
rate at which instructions are executed and synchronizes all the various
computer components.
• The CPU requires a fixed number of clock ticks (or clock cycles) to
execute each instruction. The faster the clock, the more instructions the
CPU can execute per second. Clock speeds are expressed in megahertz
(MHz) or gigahertz ((GHz).
• Some microprocessors are superscalar, which means that they can
execute more than one instruction per clock cycle.
• Like CPUs, expansion buses also have clock speeds. Ideally, the CPU clock
speed and the bus clock speed should be the same so that neither
component slows down the other. In practice, the bus clock speed is
often slower than the CPU clock speed, which creates a bottleneck. This
is why new local buses, such as AGP, have been developed.

3/26/2025 37
Examples of micro processor

• Intel 8085
• Intel 8086

3/26/2025 38
8086
 The 8086 is a 16-bit microprocessor chip
designed by Intel, which gave rise to the
x86 architecture; development work on
the 8086 design started in the spring of
1976 and the chip was introduced to the
market in the summer of 1978.
 The Intel 8088, released in 1979, was a
slightly modified chip with an external 8-
bit data bus (allowing the use of cheaper
and fewer supporting logic chips and is
notable as the processor used in the
original IBM PC.

3/26/2025 39
8085
• The Intel 8085 is an 8-bit microprocessor
introduced by Intel in 1977. An Intel 8085AH processor.

• It was binary-compatible with the more- Produced


From 1977 to
famous Intel 8080 but required less 1990s

supporting hardware, thus allowing


simpler and less expensive microcomputer Common
•Intel and
several
systems to be built. manufacturer(s)
others

3,5 and
Max. CPU clock rate
6 MHz

Instruction set pre x86

Package(s) •40 pin DIP

3/26/2025 40
Thanks

You might also like