banner



How To Perform Logical Operations Of Registers In Assembly

Registers in Calculator Architecture

Register is a very fast computer retentiveness, used to store data/teaching in-execution.

A Register is a group of flip-flops with each flip-flop capable of storing one bit of information. An n-chip annals has a group of n flip-flops and is capable of storing binary information of due north-bits.

If you are not familiar with logic gates concepts, you can learn it from here.

A register consists of a group of flip-flops and gates. The flip-flops hold the binary data and gates control when and how new information is transferred into a register. Various types of registers are bachelor commercially. The simplest annals is one that consists of only flip-flops with no external gates.

These days registers are also implemented as a register file.


Loading the Registers

The transfer of new information into a annals is referred to as loading the annals. If all the bits of register are loaded simultaneously with a common clock pulse than the loading is said to be done in parallel.


Register Transfer Linguistic communication

The symbolic note used to draw the micro-operation transfers amongst registers is chosen Register transfer language.

The term register transfer means the availability of hardware logic circuits that tin perform a stated micro-operation and transfer the result of the operation to the same or another register.

The word language is borrowed from programmers who apply this term to programming languages. This programming language is a procedure for writing symbols to specify a given computational process.

Post-obit are some commonly used registers:

  1. Accumulator: This is the most mutual register, used to store data taken out from the retentivity.
  2. General Purpose Registers: This is used to store data intermediate results during programme execution. It tin can exist accessed via assembly programming.
  3. Special Purpose Registers: Users exercise not access these registers. These registers are for Reckoner system,
    • MAR: Retentivity Accost Register are those registers that holds the accost for retention unit.
    • MBR: Memory Buffer Annals stores didactics and data received from the retentivity and sent from the retentivity.
    • PC: Program Counter points to the side by side teaching to be executed.
    • IR: Education Register holds the educational activity to be executed.

Register Transfer

Data transferred from one register to some other is designated in symbolic grade past ways of replacement operator.

R2 ← R1

It denotes the transfer of the data from register R1 into R2.

Normally we want the transfer to occur only in predetermined control condition. This can exist shown by following if-then statement: if (P=1) then (R2 ← R1)

Here P is a control signal generated in the control section.


Command Part

A control function is a Boolean variable that is equal to 1 or 0. The control function is shown equally:

P: R2 ← R1

The control condition is terminated with a colon. It shows that transfer operation can be executed simply if P=1.


Micro-Operations

The operations executed on data stored in registers are called micro-operations. A micro-operation is an elementary functioning performed on the information stored in i or more registers.

Example: Shift, count, clear and load.

Types of Micro-Operations

The micro-operations in digital computers are of 4 types:

  1. Register transfer micro-operations transfer binary information from one register to another.
  2. Arithmetic micro-operations perform arithmetic operations on numeric data stored in registers.
  3. Logic micro-operations perform scrap manipulation operation on non-numeric information stored in registers.
  4. Shift micro-operations perform shift micro-operations performed on information.

Arithmetic Micro-Operations

Some of the basic micro-operations are addition, subtraction, increase and decrement.


Add Micro-Performance

Information technology is defined by the following statement:

          R3 → R1 + R2        

The above statement instructs the data or contents of annals R1 to be added to data or content of annals R2 and the sum should exist transferred to register R3.


Subtract Micro-Functioning

Let united states of america again accept an example:

          R3 → R1 + R2' + i        

In decrease micro-performance, instead of using minus operator we have 1's compliment and add together ane to the register which gets subtracted, i.eastward R1 - R2 is equivalent to R3 → R1 + R2' + 1


Increase/Decrement Micro-Operation

Increment and decrement micro-operations are generally performed by calculation and subtracting i to and from the register respectively.

          R1 → R1 + 1        
          R1 → R1 – ane        
Symbolic Designation Clarification
R3 ← R1 + R2 Contents of R1+R2 transferred to R3.
R3 ← R1 - R2 Contents of R1-R2 transferred to R3.
R2 ← (R2)' Compliment the contents of R2.
R2 ← (R2)' + 1 2's compliment the contents of R2.
R3 ← R1 + (R2)' + 1 R1 + the two'southward compliment of R2 (subtraction).
R1 ← R1 + 1 Increment the contents of R1 by 1.
R1 ← R1 - 1 Decrement the contents of R1 by i.

Logic Micro-Operations

These are binary micro-operations performed on the bits stored in the registers. These operations consider each scrap separately and treat them as binary variables.

Permit u.s.a. consider the X-OR micro-operation with the contents of two registers R1 and R2.

          P: R1 ← R1 Ten-OR R2        

In the above argument we have also included a Command Office.

Assume that each register has iii $.25. Let the content of R1 be 010 and R2 be 100. The X-OR micro-operation will be:

Registers


Shift Micro-Operations

These are used for serial transfer of data. That means we tin shift the contents of the annals to the left or right. In the shift left operation the serial input transfers a bit to the correct most position and in shift correct functioning the serial input transfers a bit to the left most position.

There are three types of shifts as follows:

a) Logical Shift

Information technology transfers 0 through the series input. The symbol "shl" is used for logical shift left and "shr" is used for logical shift right.

          R1 ← she R1        
          R1 ← she R1        

The register symbol must exist same on both sides of arrows.

b) Round Shift

This circulates or rotates the $.25 of register around the two ends without any loss of data or contents. In this, the serial output of the shift register is connected to its series input. "cil" and "cir" is used for circular shift left and right respectively.

c) Arithmetic Shift

This shifts a signed binary number to left or right. An arithmetic shift left multiplies a signed binary number by 2 and shift left divides the number past 2. Arithmetics shift micro-operation leaves the sign bit unchanged because the signed number remains same when it is multiplied or divided by ii.


Arithmetic Logical Unit

Instead of having individual registers performing the micro-operations, computer system provides a number of registers continued to a mutual unit called every bit Arithmetic Logical Unit (ALU). ALU is the chief and i of the nearly important unit inisde CPU of figurer. All the logical and mathematical operations of computer are performed here. The contents of specific annals is placed in the in the input of ALU. ALU performs the given operation and then transfer it to the destination register.

Registers



How To Perform Logical Operations Of Registers In Assembly,

Source: https://www.studytonight.com/computer-architecture/registers

Posted by: sampsontherond.blogspot.com

0 Response to "How To Perform Logical Operations Of Registers In Assembly"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel