Unit I
Unit I
Introduction
Functional Units
• A computer organization describes the functions and design of the various
units of a digital system.
• A general-purpose computer system is the best-known example of a digital
system. Other examples include telephone switching exchanges, digital
voltmeters, digital counters, electronic calculators and digital displays.
• Computer architecture deals with the specification of the instruction set and
the hardware units that implement the instructions.
• Computer hardware consists of electronic circuits, displays, magnetic and
optic storage media and also the communication facilities.
• Functional units are a part of a CPU that performs the operations and
calculations called for by the computer program.
• Functional units of a computer system are parts of the CPU (Central
Processing Unit) that performs the operations and calculations called for by
the computer program. A computer consists of five main components
namely, Input unit, Central Processing Unit, Memory unit Arithmetic &
logical unit, Control unit and an Output unit.
Input unit
• Input units are used by the computer to read the data. The most
commonly used input devices are keyboards, mouse, joysticks,
trackballs, microphones, etc.
1) Data transfers between the memory and the registers (MOV, PUSH, POP,
XCHG).
2) Arithmetic and logic operations on data (ADD, SUB, MUL, DIV, AND, OR, NOT).
1) Memory-location
2) Processor register &
3) Registers in I/O device.
ASSEMBLY LANGUAGE NOTATION
To represent machine instructions and programs, assembly
language format is used.
BASIC INSTRUCTION TYPES
Addressing Modes
Addressing modes are techniques used in computer architecture to specify
the method by which the CPU accesses operands from memory. They define
how the CPU calculates the effective address of an operand before
performing operations like reading from or writing to memory.
Addressing modes for 8086 instructions are divided into two categories:
Example: MOV AL, 35H (move the data 35H into AL register)
Register mode:
In register addressing the operand is placed in one of 8 bit or 16 bit general
purpose registers.
The data is in the register that is specified by the instruction.
Here one register reference is required to access the data.
Here one register reference, one memory reference and one ALU operation is
required to access the data.
Auto decrement mode is same as auto increment mode. Both can also be used to implement a
stack as push and pop . Auto increment and Auto decrement modes are useful for implementing
“Last-In-First-Out” data structures.
Direct addressing/ Absolute addressing Mode (symbol [ ]):
The operand’s offset is given in the instruction as an 8 bit or 16 bit displacement
element.
In this addressing mode the 16 bit effective address of the data is the part of the
instruction.
Here only one memory reference operation is required to access the data.
• To give programmers to facilities such as Pointers, counters for loop controls, indexing of
data and program relocation.
• To reduce the number bits in the addressing field of the Instruction.
Basic Input/Output Operations
• Input/Output operations which transfer data from the processor or
memory to and from the real world are essential.
• In general, the rate of transfer from any input device to the processor,
or from the processor to any output device is likely to the slower than
the speed of a processor.
• The difference in speed makes it necessary to create mechanisms to synchronize the
data transfer between them.
• Let us consider a simple task of reading a character from a keyboard and
displaying that character on a display screen.
• A simple way of performing the task is called program-controlled I/O.
• There are two separate blocks of instructions in the I/O program that perform this
task:
• One block of instructions transfers the character into the processor.
• Another block of instructions causes the character to be displayed.
Bus
Processor
D T AIN D A TA OUT
SIN SOUT
Ke yboard Display
Input:
•When a key is struck on the keyboard, an 8-bit character code is stored in the buffer register DATAIN.
•A status control flag SIN is set to 1 to indicate that a valid character is in DATAIN.
•A program monitors SIN, and when SIN is set to 1, it reads the contents of DATAIN.
•When the character is transferred to the processor, SIN is automatically cleared.
•Initial state of SIN is 0.
• Buffer registers DATAIN and DATAOUT, and status flags SIN and SOUT are part of a
circuitry known as device interface.
• To perform I/O transfers, we need machine instructions to:
• Monitor the status of the status registers (SIN and SOUT).
• Transfer data among the I/O devices and the processor.
• Instructions have similar format to the instructions used for moving data between the
processor and the memory.
Processor Memory
Bus
•Multiple I/O devices may be connected to the processor and the memory via a bus.
•Bus consists of three sets of lines to carry address, data and control signals.
•Each I/O device is assigned an unique address.
•To access an I/O device, the processor places the address on the address lines.
•The device recognizes the address, and responds to the control signals.
• I/O device is connected to the bus using an I/O interface circuit which
has: Address decoder, control circuit, and data and status registers.
• Address decoder decodes the address placed on the address lines thus
enabling the device to recognize its address (each device has a unique
address).
• Data register (DATAIN and DATAOUT) holds the data being
transferred to or from the processor.
• Status register (SIN and SOUT) holds information necessary for the
operation of the I/O device.
• Data and status registers are connected to the data lines.
• control circuit receive and transmit the control signals through the
control line.