0% found this document useful (0 votes)
24 views

RISC, CISC & other topics

python and COA

Uploaded by

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

RISC, CISC & other topics

python and COA

Uploaded by

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

RISC

RISC stands for Reduced Instruction Set Computer Processor, a microprocessor


architecture with a simple collection and highly customized set of instructions. It is built to
minimize the instruction execution time by optimizing and limiting the number of
instructions. It means each instruction cycle requires only one clock cycle, and each cycle
contains three parameters: fetch, decode and execute. The RISC processor is also used to
perform various complex instructions by combining them into simpler ones. RISC chips
require several transistors, making it cheaper to design and reduce the execution time for
instruction.

Examples of RISC processors are SUN's SPARC, PowerPC, Microchip PIC processors,
RISC-V.

Advantages of RISC Processor

1. The RISC processor's performance is better due to the simple and limited number of
the instruction set.
2. It requires several transistors that make it cheaper to design.
3. RISC allows the instruction to use free space on a microprocessor because of its
simplicity.
4. RISC processor is simpler than a CISC processor because of its simple and quick
design, and it can complete its work in one clock cycle.

Disadvantages of RISC Processor

1. The RISC processor's performance may vary according to the code executed because
subsequent instructions may depend on the previous instruction for their execution in
a cycle.
2. Programmers and compilers often use complex instructions.
3. RISC processors require very fast memory to save various instructions that require a
large collection of cache memory to respond to the instruction in a short time.

RISC Architecture

It is a highly customized set of instructions used in portable devices due to system reliability
such as Apple iPod, mobiles/smartphones, Nintendo DS,
Features of RISC Processor

Some important features of RISC processors are:

1. One cycle execution time: For executing each instruction in a computer, the RISC
processors require one CPI (Clock per cycle). And each CPI includes the fetch,
decode and execute method applied in computer instruction.
2. Pipelining technique: The pipelining technique is used in the RISC processors to
execute multiple parts or stages of instructions to perform more efficiently.
3. A large number of registers: RISC processors are optimized with multiple registers
that can be used to store instruction and quickly respond to the computer and
minimize interaction with computer memory.
4. It supports a simple addressing mode and fixed length of instruction for executing the
pipeline.
5. It uses LOAD and STORE instruction to access the memory location.
6. Simple and limited instruction reduces the execution time of a process in a RISC.
CISC

The CISC Stands for Complex Instruction Set Computer, developed by the Intel. It has a
large collection of complex instructions that range from simple to very complex and
specialized in the assembly language level, which takes a long time to execute the
instructions. So, CISC approaches reducing the number of instruction on each program and
ignoring the number of cycles per instruction. It emphasizes to build complex instructions
directly in the hardware because the hardware is always faster than software. However, CISC
chips are relatively slower as compared to RISC chips but use little instruction than RISC.
Examples of CISC processors are VAX, AMD, Intel x86 and the System/360.

Characteristics of CISC Processor

Following are the main characteristics of the RISC processor:

1. The length of the code is shorts, so it requires very little RAM.


2. CISC or complex instructions may take longer than a single clock cycle to execute the
code.
3. Less instruction is needed to write an application.
4. It provides easier programming in assembly language.
5. Support for complex data structure and easy compilation of high-level languages.
6. It is composed of fewer registers and more addressing nodes, typically 5 to 20.
7. Instructions can be larger than a single word.
8. It emphasizes the building of instruction on hardware because it is faster to create than
the software.

CISC Processors Architecture

The CISC architecture helps reduce program code by embedding multiple operations on each
program instruction, which makes the CISC processor more complex. The CISC architecture-
based computer is designed to decrease memory costs because large programs or instruction
required large memory space to store the data, thus increasing the memory requirement, and a
large collection of memory increases the memory cost, which makes them more expensive.
Advantages of CISC Processors

1. The compiler requires little effort to translate high-level programs or statement


languages into assembly or machine language in CISC processors.
2. The code length is quite short, which minimizes the memory requirement.
3. To store the instruction on each CISC, it requires very less RAM.
4. Execution of a single instruction requires several low-level tasks.
5. CISC creates a process to manage power usage that adjusts clock speed and voltage.
6. It uses fewer instructions set to perform the same instruction as the RISC.

Disadvantages of CISC Processors

1. CISC chips are slower than RSIC chips to execute per instruction cycle on each
program.
2. The performance of the machine decreases due to the slowness of the clock speed.
3. Executing the pipeline in the CISC processor makes it complicated to use.
4. The CISC chips require more transistors as compared to RISC design.
5. In CISC it uses only 20% of existing instructions in a programming event.
Difference between the RISC and CISC Processors

RISC CISC

It is a Reduced Instruction Set Computer. It is a Complex Instruction Set Computer.

It emphasizes on software to optimize the instruction It emphasizes on hardware to optimize the


set. instruction set.

It is a hard wired unit of programming in the RISC Microprogramming unit in CISC Processor.
Processor.

It requires multiple register sets to store the It requires a single register set to store the
instruction. instruction.

RISC has simple decoding of instruction. CISC has complex decoding of instruction.

Uses of the pipeline are simple in RISC. Uses of the pipeline are difficult in CISC.

It uses a limited number of instruction that requires It uses a large number of instruction that
less time to execute the instructions. requires more time to execute the
instructions.

It uses LOAD and STORE that are independent It uses LOAD and STORE instruction in the
instructions in the register-to-register a program's memory-to-memory interaction of a program.
interaction.

RISC has more transistors on memory registers. CISC has transistors to store complex
instructions.

The execution time of RISC is very short. The execution time of CISC is longer.

RISC architecture can be used with high-end CISC architecture can be used with low-end
applications like telecommunication, image applications like home automation, security
processing, video processing, etc. system, etc.

It has fixed format instruction. It has variable format instruction.

The program written for RISC architecture needs to Program written for CISC architecture tends
take more space in memory. to take less space in memory.

Example of RISC: ARM, PA-RISC, Power Examples of CISC: VAX, Motorola 68000
Architecture, Alpha, AVR, ARC and the SPARC. family, System/360, AMD and the Intel x86
CPUs.
MICROINSTRUCTION:
A microinstruction is a single instruction in microcode, the most elementary instruction in the
computer.
Types of Microinstructions available
Types of microinstruction formats:

 Horizontal Format, called Horizontal microcode.


 Vertical Format, called Vertical microcode.

What is horizontal and vertical Microinstruction?


In vertical microprogramming, the control bits are encoded with each code being used for
each action to be performed and an instruction decoder decodes the code into multiple control
signals. On the contrary, horizontal microprogramming involves horizontal microinstructions
that use no encoding at all.

What is the difference between horizontal and vertical microinstructions?


As opposed to horizontal microinstructions, the vertical microinstruction represents single
micro-operations. Horizontal microprograms allow higher degree of parallelism with a
minimum amount of encoding and separate control fields whereas the control bits are
encoded in vertical microprograms.

What are horhorizontal microinstructions?


Horizontal microinstructions represent several micro-operations that are executed at the same
time. However, in extreme cases, each horizontal microinstruction controls all the hardware
resources of the system.

What is vertical Microinstruction?


In a vertical microinstruction, a code is used for each action to be performed, and the decoder
translates this code into individual control signals. The advantage of vertical
microinstructions is that they are more compact (fewer bits) than horizontal
microinstructions.
Difference between Horizontal and Vertical micro-programmed Control
Unit:

S.
No Horizontal µ-programmed CU Vertical µ-programmed CU

1. It supports longer control word. It supports shorter control word.

It allows a higher degree of


parallelism. If degree is n, then n It allows a low degree of parallelism i.e., the
Control Signals are enabled at a degree of parallelism is either 0 or 1.
2. time.

Additional hardware in the form of decoders


No additional hardware is required.
3. is required to generate control signals.

It is faster than a Vertical micro- it is slower than a Horizontal micro-


4. programmed control unit. programmed control unit.

It is more flexible than a vertical It is less flexible than horizontal but more
5. micro-programmed control unit. flexible than that of a hardwired control unit.

A horizontal micro-programmed A vertical micro-programmed control unit


control unit uses horizontal micro- uses vertical micro-instruction, where a code
instruction, where every bit in the is used for each action to be performed and
control field attaches to a control the decoder translates this code into
6. line. individual control signals.

The horizontal micro-programmed


The vertical micro-programmed control unit
control unit makes less use of ROM
makes more use of ROM encoding to reduce
encoding than the vertical micro-
the length of the control word.
7. programmed control unit.
Execution of a Complete Instruction:

.Control Sequence of Fetch Cycle Step Action 1


PCout,ARin,Read,Set carry in of ALU,clear y,Add,Zin
2 Zout,PCin,WMFC
3 DRout,IRin

.Control Sequence of Execution Cycle Step Action2


4 Address of IRout,ARin,Read
5 R1out,yin,WMFC
6 DRout,Add,Zin
7 Zout,R1in
8 End
TYPES OF INSTRUCTION:

1. Data Transfer Instructions :


Instructions that transfer data from one location (Register/Memory) to another location
(Register/Memory) without changing the data. Data transfer operations supported are as
follows :
 LOAD : Data transfers from memory to register.
 STORE : Data transfers from register to memory.
 MOVE : Data transfers from register to register.
 IN : Transfers data from input device to register.
 OUT : Transfers data from register to output device.
 PUSH : Gets data from register or memory on to the top of the stack.
 POP : Gets data from Top of the stack to memory or register.
 XCHG : Exchanges the data between memory and registers.
2. Data Manipulation Instructions :
 Arithmetic Instructions :
Performs an arithmetic operation such as addition, subtraction, multiplication,
division, increment, decrement etc.
Example : ADD, SUB, MUL, DIV, INC, DEC etc.
 Logical Instructions :
Performs bit-wise logical operation such as AND, OR, Exclusive-OR, NOT,
shift, rotate etc.
Example : AND, OR, NOT, XOR, SHL, SHR, ROL, ROR etc.
 Arithmetic and Logical Instructions :
Performs operations such as arithmetic shift left, arithmetic shift right.
Example : SAL, SAR etc.
3. Program Control Instructions :
-> Compare Test Instructions : To compare and test status flags we need support of
condition code register. Condition Code Register (CCR) has following flag bits:
(i) 5 status bits : To indicate the situation after the arithmetic and logic operation.
 Carry flag (C) : It indicates a carry from an addition and borrow from a
subtraction
 Overflow flag (V) : CPU sets ‘V’ flag to a logic ‘1’ when the result of an
operation is beyond of the range that can be represented.
 Negative Flag (N) : It is also called as Sign flag. Indicates that whether previous
result is negative or positive.
 Half Carry (H) : Used only for BCD (Binary Coded Decimal) operations.
 Zero Flag (Z) : Z bit is set to a logic ‘1’ when the result is ‘0’ otherwise Z=0.
Note that zero is a positive number
(ii) Two Interrupt Masking bits
(iii) One Stop Disable bit
-> Unconditional Branch Instructions : It causes an unconditional change of execution
sequence to a new location. Example : JUMP, goto etc.
-> Conditional Branch Instructions : These instructions are used to examine the values
stored in the condition code register to determine whether the specific code exists and to
branch if it does. Examples :
 BL – Branch is Less than – (<)
 BGE – Branch is greater than equal to – (>=)
 BNE – Branch if not equal – (!=) etc.
-> Subroutines : It is a program fragment that lives in user space, performs a well-defined
task if it is invoked by another user programs and returns control to the calling program
when finished. Example : CALL, RET instructions. Subroutine is used for :
 Frequently used code segments
 Library routines
-> Halting and Interrupt instructions : They are as follows –
1. NOP Instruction :
Means no operation, causes no change in the processor state other than the advancement of
the program counter. It can be used to synchronize timing.
2. HALT Instruction :
It brings a processor to an orderly halt, remaining in the idle state until restarted by
interrupt, trace, reset or external action.
3. Interrupt Instructions :
It is a mechanism by which an I/O or an instruction can suspend the normal execution of
the processor and get itself serviced. Generally, a particular task is assigned to that interrupt
signal. In microprocessor interrupt are used for data transfer between peripheral devices
and microprocessor. The instructions are –
 RESET –
It resets the processor, this may include any or all of setting registers to a initial
value, setting program counter to initial location, clearing or setting interrupts,
and sending reset signal to external devices.
 TRAP –
It is non-maskable and edge triggered interrupt. TRAP has the highest priority
among vectored interrupt. In case of sudden power failure it executes an ISR and
send the data from main memory to backup memory. It can be delayed using
HOLD signal. They can be masked by resetting the microprocessor. There is no
other way to mask it.
 INTR –
It is a level triggered and maskable interrupt. On receiving the instruction, CPU
saves the address of next instruction on the stack and executes received
instruction. it has the lowest priority. it can be disabled by resetting the
microprocessor or by DI/SIM instruction.
Computer Instructions

Computer instructions are a set of machine language instructions that a particular processor
understands and executes. A computer performs tasks on the basis of the instruction
provided.

An instruction comprises of groups called fields. These fields include:

o The Operation code (Opcode) field which specifies the operation to be performed.
o The Address field which contains the location of the operand, i.e., register or memory
location.
o The Mode field which specifies how the operand will be located.

A basic computer has three instruction code formats which are:

1. Memory - reference instruction


2. Register - reference instruction
3. Input-Output instruction

Memory - reference instruction

In Memory-reference instruction, 12 bits of memory is used to specify an address and one bit
to specify the addressing mode 'I'.

Register - reference instruction

The Register-reference instructions are represented by the Opcode 111 with a 0 in the
leftmost bit (bit 15) of the instruction.
Note: The Operation code (Opcode) of an instruction refers to a group of bits that define
arithmetic and logic operations such as add, subtract, multiply, shift, and compliment.

A Register-reference instruction specifies an operation on or a test of the AC (Accumulator)


register.

Input-Output instruction

Just like the Register-reference instruction, an Input-Output instruction does not need a
reference to memory and is recognized by the operation code 111 with a 1 in the leftmost bit
of the instruction. The remaining 12 bits are used to specify the type of the input-output
operation or test performed.

Note

o The three operation code bits in positions 12 through 14 should be equal to 111.
Otherwise, the instruction is a memory-reference type, and the bit in position 15 is
taken as the addressing mode I.
o When the three operation code bits are equal to 111, control unit inspects the bit in
position 15. If the bit is 0, the instruction is a register-reference type. Otherwise, the
instruction is an input-output type having bit 1 at position 15.
INSTRUCTION FORMATS

Instructions in a computer can be of multiple lengths with a variable number of addresses.


The various address fields in the instruction format of a computer vary as per the organization
of its registers. It depends on the multiple address fields the instruction can be categorized as
three address instructions, two address instructions, one address instruction, and zero address
instruction.

Three Address Instructions

The general format of a three address instruction is defined as −

operation source 1, source 2, destination

ADD A, B, C

where A, B, and C are the three variables that are authorized to a different area in the
memory. ‘ADD’ is the operation that is implemented on operands. ‘A’ and ‘B’ are the source
operands and ‘C’ is the destination operand.

Therefore, bits are needed to determine the three operands. n bit is needed to determine one
operand (one memory address). Likewise, 3n bits are needed to define three operands (three
memory addresses). Bits are also needed to determine the ADD operation.

Two Address Instructions

The general format of a two address instruction is defined as −

operation source, destination

ADD A, B

where A and B are the two variables that are designated to a specific location in the memory.
‘ADD’ is the operation that is implemented on the operands. This instruction adds the content
of the variables A and B and saves the result in variable B. Here, ‘A’ is the source operand
and ‘B’ is treated as both source and destination operands.

Bits are needed to determine the two operands. n bit is needed to define one operand (one
memory address). Likewise, 2n bits are needed to determine two operands (two memory
addresses). Bits are also needed to definite the ADD operation.

One Address Instruction

The general format of one address instruction is defined as −


operation source

ADD A

where A is the variable that is authorized to a specific location in the memory. ‘ADD’ is the
operation that is implemented on operand A. This instruction adds the content of the variable
A into the accumulator and saves the result in the accumulator by restoring the content of the
accumulator.

Zero Address Instructions

The locations of the operands in zero address instructions are represented implicitly. These
instructions store operands in a structure are known as a pushdown stack.
MICRO-OPERATION
A micro-operation is a simple operation performed on the data stored in one or more
registers. They transfer the data between registers. There are four types of micro-operations:-
 Register micro-operations
 Arithmetic micro-operations
 Logic micro-operations
 Shift micro-operations

In this blog, we will discuss logic micro-operations.


What are Logic Micro-Operations?
Logic micro-operations are used on the bits of data stored in registers. These micro-
operations treat each bit independently and create binary variables from them.
There are a total of 16 micro-operations available. These are-
Before discussing these logic micro-operations, let’s discuss their truth tables.
The below diagram shows the truth table for all the 16 logic micro-operations mentioned
above. Here, x and y are the variables or registers in which the data is stored and F0, F1,
….., F15 are the outputs that occur after performing these logic micro-operations.

Now, we will discuss these logic micro-operations one by one.


1. Clear
The Clear logic micro-operation is used to clear the register or set the bits of the register to 0.
To use this micro-operation, we need to feed 0 to the register. In the above truth table,
F0 represents the truth table of Clear logic micro-operation.
For example, F <- 0 means the value of the register F is set to 0 or is cleared. The previous
value of register F will be removed.
Boolean expression-
The boolean expression for the Clear logic micro-operation is F0 = 0
2. AND

in the two registers. The symbol to represent the logical AND is ∧ .


The AND logic micro-operation performs the logical AND between the bits of the data stored

Case 1: Both x and y values are true.


In the first case, if the values of both two registers are true then the result of AND operation
is 1; else, it is 0. F1 represents the truth table of AND logic micro-operation in the above truth

For example, F <- A ∧ B means the registers A and B value will undergo AND micro-
table.

operation, and the output will be stored in register F.


Boolean expression-
The boolean expression for the AND logic micro-operation will be F1 = x.y
Case 2: x is true, and y is false.
The logical AND operation we discussed above gives output 1 when both x and y are true.
There is also another AND operation which includes x but not y. Also known as inhibition,
here for performing the AND operation, the first value is taken from the x variable or register.
The second value is taken as the complement of the y variable or register. If the value of the
x register is true and of the y register is false, then the result of AND operation is 1; else, it is
0.

For example, F <- A ∧ B’ means the value of the registers A and complement B will undergo
F2 represents the truth table of inhibition AND logic micro-operation in the above truth table.

AND micro-operation, and the output will be stored in register F.


Boolean expression-
The boolean expression for the AND logic micro-operation will be F2 = x.y’
Case 3: x is false, and y is true.
The third case of logical AND operation includes y but not x. Also known as inhibition, here
for performing the AND operation, the first value is taken as the complement of the x
variable or register, and the second value is taken from the y variable or register. If the value
of the x register is false and of the y register is true, then the result of AND operation is 1;
else, it is 0.

For example, F <- A’ ∧ B means the value of the complement register A and as it is B will
F4 represents the truth table of inhibition AND logic micro-operation in the above truth table.

undergo AND micro-operation, and the output will be stored in register F.


Boolean expression-
The boolean expression for the AND logic micro-operation will be F4 = x’.y
3. Transfer A
The Transfer A logic micro-operation transfers the contents of register A (first register) to the
output register.
F3 represents the truth table of Transfer A logic micro-operation in the above truth table.
Since there is a transfer of data from the first register to the output register in this micro-
operation, its truth table is the same as the taken values of the x variable (0, 0, 1, 1).
For example, F <- A means the value of register A is moved to register F. The previous value
of register F will be removed.
Boolean expression-
The boolean expression for the Transfer A logic micro-operation is F3 = x
4. Transfer B
The Transfer B logic micro-operation transfers the contents of register B (second register) to
the output register.
F5 represents the truth table of Transfer B logic micro-operation in the above truth table.
Since there is a transfer of data from the second register to the output register in this micro-
operation, its truth table is the same as the taken values of the y variable (0, 1, 0, 1).
For example, F <- B means the value of register B is moved to register F. The previous value
of register F will be removed.
Boolean expression-
The boolean expression for the Transfer B logic micro-operation is F5 = y
5. Exclusive OR
Also known as XOR, this logic micro-operation performs the logical XOR between the data

both. The symbol to represent the Exclusive OR is ⊕.


bits stored in the two registers. The logical XOR means either x should be true or y but not

F6 represents the truth table of Exclusive OR logic micro-operation in the above truth table.

For example, F <- A ⊕ B means the registers A and B value will undergo XOR micro-
The output will be 1 when either x =1 and y = 0 or x = 0 and y = 1.

operation, and the output will be stored in register F.


Boolean expression-
The boolean expression for the Exclusive OR logic micro-operation will be F6 = x.y’ + x’.y
6. OR
two registers. The symbol to represent the logical OR is ∨.
The OR logic micro-operation performs the logical OR between the data bits stored in the

Case 1: Either x or y or both x and y values are true.


In the first case, if either the value of x register is true and y register is false, or the value of x
register is false, and y register is true, or both the values of x and y registers are true, then the
result of OR operation is 1 else it is 0. F7 represents the truth table of OR logic micro-

For example, F <- A ∨ B means the registers A and B value will undergo OR micro-
operation in the above truth table.

operation, and the output will be stored in register F.


Boolean expression-
The boolean expression for the OR logic micro-operation will be F7 = x + y
Case 2: If y, then x else not.
In the second case, the output for 1 follows the condition that
 If the value of the y register is true, then the value of the x register must be true.
If this condition is satisfied, then the output is 1.
 If the value of the y register is false, then we don’t need to look for the value of
the x register, and the output is 1.
 Else the output is 0.
To perform this logic micro-operation, we need to perform the logical OR of the values of the
x register and the complement value of the y register.

For example, F <- A ∨ B’ means the value of the registers A and complement B will undergo
In the above truth table, F11 represents the truth table of this logic micro-operation.

OR micro-operation, and the output will be stored in register F.


Boolean expression-
The boolean expression for this OR logic micro-operation will be F11 = x + y’
Case 3: If x, then y else not.
In the second case, the output for 1 follows the condition that
 If the value of the x register is true, then the y register's value must be true. If this
condition is satisfied, then the output is 1.
 If the value of the x register is 0, then we don’t need to look for the value of the y
register, and the output is 1.
 Else the output is 0.
To perform this logic micro-operation, we need to perform the logical OR of the
complemented value of the x register and the value of the y register.

For example, F <- A’ ∨ B means the complemented register A and B value will undergo OR
In the above truth table, F13 represents the truth table of this logic micro-operation.

micro-operation, and the output will be stored in register F.


Boolean expression-
The boolean expression for this OR logic micro-operation will be F13 = x’ + y
7. NOR
The NOR logic micro-operation is simply the opposite of OR logic micro-operation. As the
name suggests, it is Not OR. The output of OR micro-operation is 1 when the value of either
x register or y register or both x and y registers are true. In contrast, in NOR, the output is 0
when the value of either x register or y register or both x and y registers are true, and it is 1
when both x and y registers are false. In the above truth table, F8 represents the truth table of

For example, F <- (A ∨ B)’ means the registers A and B value will undergo NOR micro-
NOR logic micro-operation.

operation, and the output will be stored in register F.


Boolean expression-
The boolean expression for the Transfer A logic micro-operation is F8 = (x + y)’
8. Exclusive NOR
If we perform the Exclusive NOR micro-operation, the output will be 1 when the values of
both the x and y registers will be the same. They can be true or false, but they have to be the
same.
F9 represents the truth table of Exclusive NOR logic micro-operation in the above truth table.

For example, F <- (A ⊕ B)’ means the registers A and B value will undergo Exclusive NOR
The output will be 1 when either x = 0 and y = 0 or x = 1 and y = 1.

micro-operation, and the output will be stored in register F.


Boolean expression-
The boolean expression for the Exclusive NOR logic micro-operation will be F9 = x.y + x’.y’
9. Complement B
The Complement B logic micro-operation transfers the complemented contents of register B
(second register) to the output register. First, the content of the register is complemented and
then moved to the desired register.
In the above truth table, F10 represents the truth table of Complement B logic micro-
operation. Since there is a transfer of complemented data from the second register to the
output register in this micro-operation, its truth table is just the opposite of the taken values of
the y variable (1, 0, 1, 0).
For example, F <- B’ means the complemented value of register B is moved to register F.
The previous value of register F will be removed.
Boolean expression-
The boolean expression for the Complement B logic micro-operation is F10 = y’
10. Complement A
The Complement A logic micro-operation transfers the complemented contents of register A
(first register) to the output register. First, the content of the register is complemented and
then moved to the desired register.
F12 represents the truth table of Complement A logic micro-operation in the above truth
table. Since there is a transfer of complemented data from the first register to the output
register in this micro-operation, its truth table is just the opposite of the taken values of the y
variable (1, 1, 0, 0).
For example, F <- A’ means the complemented value of register A is moved to register F.
The previous value of register F will be removed.
Boolean expression-
The boolean expression for the Complement A logic micro-operation is F12 = x’
11. NAND
The NAND logic micro-operation is simply the opposite of AND logic micro-operation. As
the name suggests, it is Not AND. The output of AND micro-operation is 1 when the value of
both the x register and y register is true. In contrast, in NAND, the output is 0 when the value
of both x register and y register is true, and it is 1 when either x is false, or y is false, or both
are false.

For example, F <- (A ∧ B)’ means the registers A and B value will undergo NAND micro-
In the above truth table, F14 represents the truth table of NAND logic micro-operation.

operation, and the output will be stored in register F.


Boolean expression-
The boolean expression for the NAND logic micro-operation is F14 = (x.y)’
12. Set to all 1’s
The set to all 1’s logic micro-operations is used to set all the register bits to 1. To use this
micro-operation, we just need to feed 1 to the register. In the above truth table, F15 represents
the truth table of Set to all 1’s logic micro-operation.
For example, F <- 1 means the value of the register F is set to 1. The previous value of
register F will be removed.
The following table shows the symbolic representation of various Arithmetic Micro-
operations.

Symbolic Representation Description

R3 ← R1 + R2 The contents of R1 plus R2 are transferred to R3.

R3 ← R1 - R2 The contents of R1 minus R2 are transferred to R3.

R2 ← R2' Complement the contents of R2 (1's complement)

R2 ← R2' + 1 2's complement the contents of R2 (negate)

R3 ← R1 + R2' + 1 R1 plus the 2's complement of R2 (subtraction)

R1 ← R1 + 1 Increment the contents of R1 by one

R1 ← R1 – 1 Decrement the contents of R1 by one

Shift micro-operations
Shift micro-operations are those micro-operations that are used for the 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 shift micro-
operations: 1.
1. Logical Shift:
It transfers the 0 zero through the serial input. We use the symbols ‘<<‘ for the logical left
shift and ‘>>‘ for the logical right shift.
Logical Left Shift:
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.
The left shift operator is denoted by the double left arrow key (<<). The general syntax for
the left shift is shift-expression << k.
Logical Left Shift
Note: Every time we shift a number towards the left by 1 bit it multiplies that number by 2.
Logical Right Shift
In this shift, each bit moves to the right one by one and the least significant bit(LSB) is
rejected and the empty MSB is filled with zero.
The right shift operator is denoted by the double right arrow key (>>). The general syntax
for the right shift is “shift-expression >> k”.

Logical Right Shift


Note: Every time we shift a number towards the right by 1 bit it divides that number by 2.
2. Arithmetic Shift:
The arithmetic shift micro-operation moves the signed binary number either to the left or to
the right position.
Following are the two ways to perform the arithmetic shift.
1. Arithmetic Left Shift
2. Arithmetic Right Shift
Arithmetic Left Shift:
In this shift, each bit is moved 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.

Arithmetic Left Shift


Arithmetic Right Shift:
In this shift, each bit is moved to the right one by one and the least significant(LSB) bit is
rejected and the empty most significant bit(MSB) is filled with the value of the previous
MSB.

Arithmetic Right Shift


3. Circular Shift:
The circular shift circulates the bits in the sequence of the register around both ends without
any loss of information.
Following are the two ways to perform the circular shift.
1. Circular Shift Left
2. Circular Shift Right
Circular Left Shift:
In this micro shift operation each bit in the register is shifted to the left one by one. After
shifting, the LSB becomes empty, so the value of the MSB is filled in there.

Circular Left Shift


Circular Right Shift:
In this micro shift operation each bit in the register is shifted to the right one by one. After
shifting, the MSB becomes empty, so the value of the LSB is filled in there.

Circular Right Shift


Program Control Instructions
Program control instructions are used to change or modify the flow of a program. There are
some instructions here to control the flow of the program.

Types of Program Control Instructions

Program control instructions has 5 major types which are explained below
1. BRANCH/JUMP

Branch word is used in direct addressing mode while Jump word is used in indirect
addressing mode with the same task. it moves from one location to another defined location.
2. SKIP

It skips that specific instruction where we defined skip instruction


3. CALL & RETURN

It works like a subroutine. When we CALL, it transfers control to a specific position when it
found RETURN it returns back to the next instruction from where It was called.
4. COMPARE

It is a condition between two variables like A>B, A<B, etc.


5. TEST

The test bit is used to set any value to zero to test the results. Mostly used in Flags.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy