Lecture 4 Arithmetic and Logi Unit and Assembly Language
Lecture 4 Arithmetic and Logi Unit and Assembly Language
The basic operations are implemented in hardware level. ALU is having collection
collect of two
types of operations:
Arithmetic operations
Logical operations
To identify any one of these four logical operations or four arithmetic operations, two
control lines are needed. Also to identify the any one of these two groups
groups- arithmetic or
logical, another control line is needed. So, we need three control lines.
We need three control lines to identify any one of these operations. The input
combination of these control lines are shown below:
Control line ଶ is used to identify the group: logical or arithmetic, i.e.
ଶ 0:: arithmetic operation ଶ 1: logical operation.
Control lines and ଵ are used to identify any one of the four operations in a group.
One possible combination is given here.
A 3X8 decode is used to decode the instruction. The block diagram of the ALU is shown
in figure
Block Diagram of the ALU
The ALU has got two input registers named as A and B and one output storage register,
named as C. It performs the operation as:
C=A op B
The input data are stored in A and B, and according to the operation specified in the
control lines, the ALU perform the operation and put the result in register C.
As for example, if the contents of controls lines are, 000, then the decoder enables the
addition operation and it activates the adder circuit and the addition operation is
performed onn the data that are available in storage register A and B . After the completion
of the operation, the result is stored in register C.
We should have some hardware implementations for basic operations. These basic
operations can be used to implement some complicated operations which are not feasible
to implement directly in hardware.
8086 has 117 instructions, 8086 instruction set consists of the following instructions:
Data transfer instructions---- MOV, PUSH
Arithmetic - add, subtract, increment and decrement -----ADD, SUB, MUL,
DIV, INC.
Logic instructions – NOT, AND, OR, XOR.
Control transfer –
o Conditional, unconditional program branch---- LOOP, LOOPE, LOOPZ.
o Conditional, unconditional call subroutines--- CALL, JMP, JA, JNBE.
Enabling/disabling interrupts---- INT, INTO, IRET.
Stack operations----PUSH, POP.
Simple Input and Output port transfer instructions----IN, OUT
Special Address transfer instructions ------LEA, LDS
Setting/Clearing flag bits--- STC, CLC, STD, CLD
String Instructions ------MOVS, MOVSB, MOVSW.
External Hardware Synchronization instructions---- HLT, WAIT, NOP