0% found this document useful (0 votes)
13 views13 pages

Unit 02

cp note

Uploaded by

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

Unit 02

cp note

Uploaded by

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

UNIT -02

Register transfer and micro operation

Course of contents

Register transfer and RTL


Micro operation
Data transfer micro operation
Arithmetic and logical micro operation
Shift micro operation
Introduction of HDL and VHDL

1.1 Register transfer and RTL

Register-
 A Register is a fast memory used to accept, store, and transfer data and instructions that are being used
immediately by the CPU.
 A Register can also be considered as a group of flip-flops with each flip-flop capable of storing one bit of
information.
Register transfer
The information transformed from one register to another register is represented in symbolic form by
replacement operator is called Register Transfer.
Replacement Operator :
In the statement, R2 R1, acts as a replacement operator. This statement defines the transfer of
content of register R1 into register R2.

Er. Manish Kr.Yadav (Unit -02 , Comp. Arch. ) Page 1


There are various methods of RTL –
1. General way of representing a register is by the name of the register inclosed in a rectangular
box as shown in (a).

2. Register is numbered in a sequence of 0 to (n-1) as shown in (b).

3. The numbering of bits in a register can be marked on the top of the box as shown in (c).

4. A 16-bit register PC is divided into 2 parts- Bits (0 to 7) are assigned with lower byte of 16-bit
address and bits (8 to 15) are assigned with higher bytes of 16-bit address as shown in (d).

Register Transfer Operations:


The operation performed on the data stored in the registers are referred to as register transfer
operations.
There are different types of register transfer operations:
1. Simple Transfer – R2 <- R1
The content of R1 are copied into R2 without affecting the content of R1. It is an unconditional type of
transfer operation.

2. Conditional Transfer –

Er. Manish Kr.Yadav (Unit -02 , Comp. Arch. ) Page 2


It indicates that if P=1, then the content of R1 is transferred to R2. It is a unidirectional operation.
3. Simultaneous Operations –
If 2 or more operations are to occur simultaneously then they are separated with comma (,).

If the control function P=1, then load the content of R1 into R2 and at the same clock load the content
of R2 into R1.

1.2 Micro operation

In computer central processing units, micro-operations (also known as micro-ops) are the functional or
atomic, operations of a processor. These are low level instructions used in some designs to implement
complex machine instructions. They generally perform operations on data stored in one or
more registers.

Er. Manish Kr.Yadav (Unit -02 , Comp. Arch. ) Page 3


Or ,

Er. Manish Kr.Yadav (Unit -02 , Comp. Arch. ) Page 4


1.3 Data transfer micro operation

Register Transfer Micro-operation: this type of micro operations are used to transfer from one register
to other binary information. The term register transfer means transfer the result of the operation to the
same or another register. Following are some commonly used registers:

 Accumulator: adding a sequence of numbers.


 General Purpose Registers: are available to store the data required by the program.
 Special Purpose Registers: Users do not access SPR. These registers are for Computer system.
 Memory Address Register: MAR are those registers that hold the address for memory unit.
 Memory Buffer Register: MBR stores instruction and data received from the memory and sent
from the memory.
 Program Counter: informs the user to execute next instruction to be executed.
 Instruction Register: IR holds the instruction being executed or decoded.
 Information is transferred from one register to other in a symbolic form.

R2 ← R1, The data get transfer from register R1 into R2.

1.4 Arithmetic and logical micro operation

Arithmetic Micro-Operations: A micro operation is an elementary operation performed with the data
stored in the registers. It performs arithmetic operation on numeric data stored in registers.

Er. Manish Kr.Yadav (Unit -02 , Comp. Arch. ) Page 5


 Addition Micro-Operation:-It is defined by the following statement:

R3 → R1 + R2

It states that the contents of the register R1 are added with the content of the register R2 and the result
will be transferred to register R3.

 Subtract Micro-Operation:-It is defined by the following statement, Let us take an example

R3 → R1 + R2′ + 1

In subtract micro-operation, instead of using minus operator we take 1’s compliment and add 1 to the
register which gets subtracted, i.e. R1 – R2 is equivalent to R3 → R1 + R2′ + 1

 Increment/Decrement Micro-Operation:- In Increment the content of the register increment by


1 and In decrement the content of the register decrement by 1.

R1 → R1 + 1
R1 → R1 – 1

Symbolic
Description
Designation

R3 ← R1 + R2 Contents of R1+R2 get transfer to R3.

R3 ← R1 – R2 Contents of R1-R2 get transfer to R3.

R2 ← (R2)’ Compliment the contents of R2.

R2 ← (R2)’ + 1 2’s compliment the contents of R2.

R3 ← R1 + (R2)’
R1 + the 2’s compliment of R2 (subtraction).
+1

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

Er. Manish Kr.Yadav (Unit -02 , Comp. Arch. ) Page 6


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

Logic Micro-operations – Logic micro-operations are working of few logic gates. Logic gates are used
to implement the Boolean function, and gates are the circuits that can allow or cannot allow current to
pass through them. If current passes, it gives value 1, otherwise it gives value 0.

There are four types of logic micro-operations and denoted like this:-
AND – AND gate is known as a series circuit. R2 and R3 contain two inputs, and the result is stored in
R1.
R1 ← R2^ R3

AND Gate Truth table

OR – OR gate, we use the disjunction symbol. Two inputs are stored in R2 and R3 register, and the result
is stored in R1.
R1 ← R2+R3

OR Gate Truth table

X-OR – It is like an OR gate, but excluding both inputs are true. X-OR gate has two inputs in two
registers, and the result is stored in R1.

Er. Manish Kr.Yadav (Unit -02 , Comp. Arch. ) Page 7


R1← R2⊕R3

X-OR Gate Truth table

X-NOR– This is an X-OR gate with an inverted output. X-NOR gate has two inputs in two registers, and
the result is stored in R1.
R1← R2 ʘ R3

X-NOR Gate Truth table

1.5 Shift micro operation

There are three types of shift micro-operations and denoted like this:-

Er. Manish Kr.Yadav (Unit -02 , Comp. Arch. ) Page 8


Logical shift
The logic shift means that we have to shift digits logically from one place to another place. It is of two
types:- Left shift or Right shift.

 Left shift:- let suppose a register has 4 bit 1011, and if we shift this value to left, then the left-
most digit is discarded and remaining three are shifted to the left, and the new digit 0 is added to
the number (remember that always 0 is added as a new digit). Now a new number is 0110 after
left shift.
1011à 0110
 Right-shift – let suppose a register has 4 bit 1011. If we shift this value to the right, then the
rightmost digit is discarded, and remaining three are shifted to the right, and the new digit 0 is
added to the number (remember that always 0 is added as a new digit). Now a new number is
1010 after the right shift.
1011à 1010

Circular Shift
As the name defined, circular means circle or in rotation. Here digits are not discarded; they are shifted in
a circular motion.
The circular shift is also of two types:- Left circular shift and Right circular shift.

Left circular shift:- let suppose a register has 4 bit 1011, and if we shift this value in circular, then the
left-most digit is not discarded. It is shifted to the rightmost corner, and the remaining three are shifted to
the left. Now a new number is 0111 in the register after applying the left circular shift.
1011à 0111
Right circular shift:- let suppose a register has 4 bit 1011, and if we shift this value in circular, then the
rightmost digit is not discarded; it is shifted to a left most corner, and the remaining three are shifted to
the right. Now a new number is 1101 in the register after the right circular shift.
1011à1101

Arithmetic Shift – The arithmetic shift is applied to signed values or signed numbers. There is a
constraint in an arithmetic shift that whether it is left shift or right shift on any number which is a signed
number then after the shift the signed should remain same. If arithmetic left or right shift is applied to the
positive number, it remains positive after the shift. If the initial number is negative, then after shifting, the
answer remains negative.

Er. Manish Kr.Yadav (Unit -02 , Comp. Arch. ) Page 9


Left arithmetic shift: It is the same as a logical left shift, but it is allowed only when the sign is not
going to change. If left arithmetic shift is applied on a negative number then after shifting that number,
answer comes negative, it is allowed by CPU and in other case too if the number is positive and after
shifting that number, answer comes negative, in some cases it is also not allowed by CPU.
For example: Suppose the number is 1101(-ve number due to M.S.B. is 1)
1101 à 1010 (-ve number)

So, it is allowed but let’s take another number, 1011(-ve number), apply shift on this
number. 1011à 0110(+ve number)

Now, 0110 is positive because the M.S.B. bit is 0. CPU does not process arithmetic left shift on this
number. CPU gives an error named Arithmetic left shift overflow. Therefore a number on which
arithmetic left shift is not allowed generates an error called arithmetic left shift overflow.

Right arithmetic shift: let suppose a register has 4-bit 1011 number and it’s a negative number as
M.S.B. of number is 1. If we shift this value, the rightmost digit is discarded, the remaining three digits
are shifted to the right, and to maintain the sign(negative or positive) of number the left-most digit is
copied as M.S.B. ( same to same). Now the result after the right arithmetic shift is 1101. 1011à 1101

1.6 Introduction of HDL and VHDL

What is HDL?

HDL stands for Hardware Description Language. It is a programming language that is used
to describe, simulate, and create hardware like digital circuits (ICS). HDL is mainly used to discover the
faults in the design before implementing it in the hardware.

 It is specialized computer language


 Used to described the structure and behavior of electronic circuits.
 HDLs include the Notion of time

The main advantage of HDLs is that it provides flexible modeling capabilities and can express the large
complex designs ( >107 gates).

Er. Manish Kr.Yadav (Unit -02 , Comp. Arch. ) Page 10


Today, there are many HDLs available in the market, but VHDL and Verilog are the most popular HDLs.

Exception Handling in Java - Javatpoint

What is VHDL?

VHDL stands for Very High-Speed Integration Circuit HDL (Hardware Description Language). It is an
IEEE (Institute of Electrical and Electronics Engineers) standard hardware description language that is
used to describe and simulate the behavior of complex digital circuits.

The most popular examples of VHDL are Odd Parity Generator, Pulse Generator, Priority Encoder,
Behavioral Model for 16 words, 8bit RAM, etc.

VHDL supports the following features:

 Design methodologies and their features.


 Sequential and concurrent activities.
 Design exchange
 Standardization
 Documentation
 Readability
 Large-scale design
 A wide range of descriptive capability

Er. Manish Kr.Yadav (Unit -02 , Comp. Arch. ) Page 11


What is Verilog?

Verilog is also a HDL (Hardware Description Languages) for describing electronic circuits and systems.
It is used in both hardware simulation and synthesis.

The most popular examples of Verilog are network switch, a microprocessor, a memory, a simple flip-
flop, etc

History of VHDL

VHDL was developed by the Department of Defence (DOD) in 1980.

 1980: The Department of Defence wanted to make circuit design self-documenting.


 1983: The development of VHDL began with a joint effort by IBM, Inter-metrics, and Texas
Instruments.
 1985 (VHDL Version 7.2): The final version of the language under the government contract was
released.
 1987: DOD permitted for commercial purpose, and VHDL became IEEE Standard 1076-1987.
 1993: VHDL was re-standardized to enhance the language
 1996: A VHDL package used with synthesis tools and became a part of the IEEE 1076 standard.
 1999: Analog Mixed Signal extension (VHDL-AMS)
 2008: IEEE Standard 1076-2008 (New features) was released.

Why VHDL?

VHDL is used for the following purposes:

 For Describing hardware


 As a modeling language
 For a simulation of hardware
 For early performance estimation of system architecture
 For the synthesis of hardware

Advantages of VHDL is given below:

 It supports various design methodologies like Top-down approach and Bottom-up approach.
 It provides a flexible design language.
 It allows better design management.
 It allows detailed implementations.
 It supports a multi-level abstraction.
 It provides tight coupling to lower levels of design.
 It supports all CAD tools.
 It strongly supports code reusability and code sharing.

Er. Manish Kr.Yadav (Unit -02 , Comp. Arch. ) Page 12


Disadvantages of VHDL

A list of disadvantages of VHDL is given below:

 It requires specific knowledge of the structure and syntax of the language.


 It is more difficult to visualize and troubleshoot a design.
 Some VHDL programs cannot be synthesized.
 VHDL is more difficult to learn.

Varilog C programming
1 HDL used to model A general purpose programming language that
electronic system allow structured programming
2 HDLs have a Notion of Have not a Notion of time
time

3 Help to design and Help to build OS Databases,


describe digital system compilers,interpreters etc.
4 File have .v extension File have .c extension

Varilog VHDL
1 used to model electronic Used in electronic design automation to describe
system digital and mixed signal system
2 Weakly type Strongly type
3 Based on c Based on pascal and ada language
programming
4 Case sensitive Not Case sensitive
5 Simple data type Complex
6 It is newer than VHDL Older then verilog
7 Less complex More complex

Er. Manish Kr.Yadav (Unit -02 , Comp. Arch. ) Page 13

You might also like