You are on page 1of 6

Annex A:

MODULE # _04__ GRADING PERIOD: _Midterm___ Google Classroom Code: ___qtxo6pt_____

SUBJECT Architecture and Organization


OBJECTIVES Period
At the end of this module, students should be able to: Covered/Duration:
1. Recognize the different major micro-operations inside the CPU. (Week # - Hours)
2. Identify the differences between each arithmetic, logic, and shift micro-
operation. Week 1, 3 hours

EXPECTED OUTPUT: Measurement and


1. Analysis/computation. Evaluation:

TOPICS Arithmetic, Logic, and Shift Micro-Operations


DISCUSSION

ARITHMETIC MICRO OPERATIONS IN REGISTERS

We can perform arithmetic operations on the numeric data which is stored inside the registers.

Example :

R3 <- R1 + R2

The value in register R1 is added to the value in the register R2 and then the sum is transferred into register R3.
Similarly, other arithmetic micro-operations are performed on the registers.

Addition –
In addition micro-operation, the value in register R1 is added to the value in the register R2 and then the sum is
transferred into register R3.

Subtraction –
In subtraction micro-operation, the contents of register R2 are subtracted from contents of the register R1, and
then the result is transferred into R3.
There is another way of doing the subtraction. In this, 2’s complement of R2 is added to R1, which is equivalent to
R1 – R2, and then the result is transferred into register R3.

Increment –
In Increment micro-operation, the value inside the R1 register is increased by 1.

Decrement –
In Decrement micro-operation, the value inside the R1 register is decreased by 1.

1’s Complement –
In this micro-operation, the complement of the value inside the register R1 is taken.

2’s Complement –
In this micro-operation, the complement of the value inside the register R2 is taken and then 1 is added to the
value and then the final result is transferred into the register R2. This process is also called Negation. It is
equivalent to -R2.

LOGIC MICRO-OPERATIONS

Logic operations are fundamentally binary operations that are performed on string of bits stored in the registers.
For a logic micro-operation every bit of a register is treated as a variable.

A logic micro-operation:
R1 ← R1.R2 specifies AND operation to be
performed on contents of R1 and R2 in
addition store the results in R1. For
illustration if R1 and R2 are 8 bits registers
and:

R1 comprise 10010011 and

R2 comprise 01010101

Then R1 will comprise 00010001 after AND


operation.

Some of the common logic micro-operations


are AND, OR, NOT or Complement, Exclusive
OR, NOR and NAND. In many computers only
four: AND, OR, XOR (exclusive OR) and
complement micro-operations are
implemented.

Let's now discuss how these four micro-


operations can be employed in
implementing some of significant
applications of manipulation of bits of a
word like changing some bit values or
deleting a group of bits. We are presuming
that resultof logic micro-operations go back
to Register R1 and R2 comprises the second
operand.

We will play a trick with manipulations we


are performing. Let's select 1010 as 4 bit
data for register R1 and 1100 data for
register R2. Why? Since if you see bit
combinations of R2 and R1 they represent
the truth table entries (read from right to
left and bottom to top) 00, 01, 10 and 11. So
resultant of logical operation on them will
signify which logic micro-operation is
required to be performed for that data manipulation. The below table gives details on some of these operations:

R1 1 0 1 0

R2 1 1 0 0

SHIFT MICRO-OPERATIONS
Shift micro-operations are those micro-operations that are used for serial transfer of information. These are also
used in conjunction with arithmetic micro-operation, logic micro-operation, and other data-processing
operations.

There are three types of shifts micro-operations:

1. Logical :
It transfers the 0 zero through the serial input. We use the symbols shl for logical shift-left and shr for shift-right.

Logical Shift Left –


In this shift one position moves each bit to the left one by one. The Empty least significant bit (LSB) is filled with
zero (i.e, the serial input), and the most significant bit (MSB) is rejected.

Right Logical Shift –


In this one position moves each bit to the right one by one and the least significant bit(LSB) is rejected and the
empty MSB is filled with zero.

2. Arithmetic :
This micro-operation shifts a signed binary number to the left or to the right position. In an arithmetic shift-left, it
multiplies a signed binary number by 2 and In an arithmetic shift-right, it divides the number by 2.

Left Arithmetic Shift –


In this one position moves each bit to the left one by one. The empty least significant bit (LSB) is filled with zero
and the most significant bit (MSB) is rejected. Same as the Left Logical Shift.
Right Arithmetic Shift –
In this one position moves each bit to the right one by one and the least significant bit is rejected and the empty
MSB is filled with the value of the previous MSB.

3. Circular :
The circular shift circulates the bits in the sequence of the register around the both ends without any loss of
information.

Left Circular Shift –

Right Circular Shift –


REFERENCES/LINKS

LEARNING ACTIVITY

1. Using Selective Set Operation, consider register A contains 1011 and register B contains 1010. What will
be the result?

2. Using Selective Complement Operation, consider register A contains 0011 and register B contains 1110.
What will be the result?

3. Using Mask Operation, consider register A contains 1010 and register B contains 1010. What will be the
result?

4. Using Insert Operation, consider register A contains 1011 and register B contains 0110. What will be the
result?

5. Using Clear Operation, consider register A contains 1001 and register B contains 1000. What will be the
result?

Subject Teacher Erwin S. Mapa E-mail Address: vspardason@gmail.com


Contact Number 09288448249 FB Name: Ervin Karte
Date of
School Registrar Sarah Irika B. Gardiola
Submission:

You might also like