Unit 02
Unit 02
Course of contents
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.
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).
2. Conditional Transfer –
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.
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.
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:
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.
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.
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
R1 → R1 + 1
R1 → R1 – 1
Symbolic
Description
Designation
R3 ← R1 + (R2)’
R1 + the 2’s compliment of R2 (subtraction).
+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
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
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.
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
There are three types of shift micro-operations and denoted like this:-
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.
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
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.
The main advantage of HDLs is that it provides flexible modeling capabilities and can express the large
complex designs ( >107 gates).
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.
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
Why VHDL?
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.
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
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