Nothing Special   »   [go: up one dir, main page]

CSA - Unit2

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 43

Registers

A Register is a collection of flip flops. A flip flop is used to store single bit digital data. For storing a large number of
bits, the storage capacity is increased by grouping more than one flip flops. If we want to store an n-bit word, we have
to use an n-bit register containing n number of flip flops

Register load
The transfer of new information into a register is referred to as loading the register. If all the bits of the register are
loaded simultaneously with a common clock pulse transition, we say that the loading is done in parallel.
Shift Registers
1. Shift Register is a group of flip flops used to store multiple bits of data.
2. The bits stored in such registers can be made to move within the registers and in/out of the registers by applying
clock pulses.
3. An n-bit shift register can be formed by connecting n flip-flops where each flip-flop stores a single bit of data.
4. The registers which will shift the bits to the left are called “Shift left registers”.
5. The registers which will shift the bits to the right are called “Shift right registers”.

The serial input determines what goes into the leftmost position during the shift.
The serial output is taken from the output of the rightmost flip-flop.
Types of Shift Registers

• Serial In Serial Out shift register


• Serial In parallel Out shift register
• Parallel In Serial Out shift register
• Parallel In parallel Out shift register
• Bidirectional Shift Register
• Universal Shift Register

Serial-In Serial-Out Shift Register (SISO)


The shift register, which allows serial input (one bit after the other through a single data line) and produces a serial output
is known as a Serial-In Serial-Out shift register. Since there is only one output, the data leaves the shift register one bit at
a time in a serial pattern, thus the name Serial-In Serial-Out Shift Register
Serial-In Parallel-Out Shift Register (SIPO)

The shift register, which allows serial input (one bit after the other through a single data line) and produces a parallel
output is known as the Serial-In Parallel-Out shift register. The logic circuit given below shows a serial-in-parallel-out
shift register. The circuit consists of four D flip-flops which are connected. The clear (CLR) signal is connected in
addition to the clock signal to all 4 flip flops in order to RESET them. The output of the first flip-flop is connected to the
input of the next flip flop and so on
Parallel-In Serial-Out Shift Register (PI

The shift register, which allows parallel input (data is given separately to each flip flop and in a simultaneous manner) and
produces a serial output is known as a Parallel-In Serial-Out shift register. The logic circuit given below shows a parallel-in-
serial-out shift register. The circuit consists of four D flip-flops which are connected. SO)
Parallel-In Parallel-Out Shift Register (PIPO)

The shift register, which allows parallel input (data is given separately to each flip flop and in a simultaneous manner)
and also produces a parallel output is known as Parallel-In parallel-Out shift register
Bidirectional Shift Register
S.N. Condition Operation

If M = 1, then the AND gates 1, 3, 5 and 7 are enabled whereas the


remaining AND gates 2, 4, 6 and 8 will be disabled.
1 With M = 1 − Shift right operation The data at DR is shifted to right bit by bit from FF-3 to FF-0 on the
application of clock pulses. Thus with M = 1 we get the serial right
shift operation.

When the mode control M is connected to 0 then the AND gates 2,


4, 6 and 8 are enabled while 1, 3, 5 and 7 are disabled.
2 With M = 0 − Shift left operation The data at DL is shifted left bit by bit from FF-0 to FF-3 on the
application of clock pulses. Thus with M = 0 we get the serial right
shift operation.
Universal Shift Register

Universal Shift Register is a type of register that contains the both right shift and the left shift. It has also parallel
load capabilities. Generally, these types of registers are taken as memory elements in computers. But, the problem
with this type of register is that it shifts only in one direction. In simple words, you mean that the universal shift
register is a combination of the bidirectional shift register and the unidirectional shift register.
Binary Counter
A register that goes through a predetermined sequence of states upon the application of input
pulses is called a counter.

The binary counters are built up of flip flops, where a flip flop is a most elementary memory
element that can store 1-bit of information. In a binary counter, each flip flop represents one bit
of the binary number. The counter increases its count by one whenever a clock pulse occurs.

Types of Binary Counters


Asynchronous Counter
Synchronous Counter
Up Counter
Down Counter
Up/Down Counter
Asynchronous Counter − The type of binary counter in which the flip flops do not receive
the same clock pulse at the same time is called an asynchronous counter. The asynchronous
counter is also known as ripple counter.

Synchronous Counter − The type of binary counter in which all the flip flops receive the
same clock pulse at the same time is known as a synchronous counter.

Up Counter − The type of binary counter that counts upwards from zero to its maximum
count value is known as up counter. In the case of up counter, the count is increased by one
on each clock pulse.

Down Counter − The type of binary counter that counts downwards from its maximum count
value to zero is known as a down counter. In the down counter, the count value of the counter
is decreased by one on each clock pulse.

Up/Down Counter − The type of binary counter that can count in both upward and
downward directions is known as a up/down counter. In the up/down counter, the direction of
count is determined by a control input signal
Memory Unit
A memory unit is a collection of storage cells together with associated circuits needed to transfer information in and out of
storage. The memory stores binary information in groups of bits called words

A memory word is a group of l's and O's and may represent a number, an instruction code, one or more alphanumeric
characters, or any other binary-coded information. A group of byte eight bits is called a byte.

Computer memories may range from 1024 words, requiring an address of 10 bits, to 2 32 words, requiring 32 address bits. It is
customary to refer to the number of words (or bytes) in a memory with one of the letters K (kilo), M (mega), or G (giga).
K is equal to 210
M is equal to 220
and G is equal to 230
Thus 64K = 216
2M = 221 and 4G=232
Two major types of memories are used in computer systems: random-access
memory (RAM) and read-only memory (ROM).

Random-Access Memory: In random-access memory (RAM) the memory cells can be


accessed for information transfer from any desired random location.

The two operations that a random-access memory can perform are the write and read
operations. The write signal specifies a transfer-in operation and the read signal specifies
a transfer-out operation.
The steps that must be taken for the purpose of transferring a new word to be stored
into memory are as follows:
1.Apply the binary address of the desired word into the address lines.

2.Apply the data bits that must be stored in memory into the data input lines.

3. Activate the write input.

The steps that must be taken for the purpose of transferring a stored word out of
memory are as follows:
1. Apply the binary address of the desired word into the address lines.
2. Activate the read input.
Read-Only Memory

a read-only memory (ROM) is a memory unit that performs the read operation only; it does not have a write
capability. This implies that the binary information stored in a ROMis made permanent during the hardware
production of the unit and cannot be altered by writing different words into it.
Types of ROMs

Programmable read-only memory or PROM.:

Electrically Erasable PROM


Data Types
• The data types found in the registers of digital computers may be
classified as being one of the following categories:

(1) numbers used in arithmetic computations,


(2) letters of the alphabet used in data processing, and
(3) other discrete symbols used for specific purposes.
Number Systems
• A number system of base or radix, r is a system that uses distinct
symbols for r digit. Numbers are represented by a string of digit
symbols .
• Computer architecture supports following number systems.
Binary number system
Octal number system
Decimal number system
Hexadecimal (hex) number system
• BINARY NUMBER SYSTEM A Binary number system has only two digits that
are 0 and 1. Every number (value) represents with 0 and 1 in this number
system. The base of binary number system is 2, because it has only two
digits.
• OCTAL NUMBER SYSTEM Octal number system has only eight (8) digits from 0
to 7. Every number (value) represents with 0,1,2,3,4,5,6 and 7 in this number
system. The base of octal number system is 8, because it has only 8 digits.
• DECIMAL NUMBER SYSTEM Decimal number system has only ten (10) digits
from 0 to 9. Every number (value) represents with 0,1,2,3,4,5,6, 7,8 and 9 in
this number system. The base of decimal number system is 10, because it has
only 10 digits.
• HEXADECIMAL NUMBER SYSTEM A Hexadecimal number system has sixteen
(16) alphanumeric values from 0 to 9 and A to F. Every number (value)
represents with 0,1,2,3,4,5,6, 7,8,9,A,B,C,D,E and F in this number system.
The base of hexadecimal number system is 16, because it has 16
alphanumeric values. Here A is 10, B is 11, C is 12, D is 14, E is 15 and F is 16.
Step 1: Conversion of 110 to decimal
=> 110 = (1*22) + (1*21) + (0*20)
=> 110 = 4 + 2 + 0
=> 110 = 6
So equivalent decimal of binary integral is 6.

Step 2: Conversion of .101 to decimal


=> 0.101 = (1*1/2) + (0*1/22) + (1*1/23)
=> 0.101 = 1*0.5 + 0*0.25 + 1*0.125
=> 0.101 = 0.625
So equivalent decimal of binary fractional is 0.625

Step 3: Add result of step 1 and 2.


=> 6 + 0.625 = 6.625
• Example − Convert binary number 10010110 into octal
number.
First convert this into decimal number
= (10010110)2
= 1x27+0x26+0x25+1x24+0x23+1x22+1x21+0x20
= 128+0+0+16+0+4+2+0
= (150)10
Then, convert it into octal number
= (150)10
= 2x82+2x81+6x80
= (226)8 which is answer.
Convert binary number 1010111100 into octal number.

= (1010111100)2
= (001 010 111 100)2
= (1 2 7 4)8
= (1274)8

Convert binary number 0110 011.1011 into octal number.

= (0110 011.1011)2
= (0 110 011 . 101 1)2
= (110 011 . 101 100)2
= (6 3 . 5 4)8
= (63.54)8
Fixed-Point Representation
• Positive integers, including zero, can be represented as unsigned
numbers. However, to represent negative integers, we need a notation for
negative values.
• Integer Representation
When an integer binary number is positive, the sign is represented by 0 and
the magnitude by a positive binary number. When the number is negative,
the sign is represented by 1 but the rest of the number may be represented
in one of three possible ways:

1. Signed-magnitude representation
2. Signed-l's complement representation
3. Signed 2's complement representation
• The signed-magnitude representation of a negative number consists
of the magnitude and a negative sign. In the other two
representations, the negative number is represented in either the l's
or 2's complement of its positive value.
• consider the signed number 14 stored in an 8-bit register. +14 is
represented by a sign bit of 0 in the leftmost position followed by the
binary equivalent of 14: 00001110. Note that each of the eight bits of
the register must have a value and therefore 0's must be inserted in
the most significant positions following the sign bit. Although there is
only one way to represent +14, there are three different ways to
represent —14 with eight bits.
• In signed-magnitude representation 1 0001110
• In signed-l's complement representation 1 1110001
• In signed-2's complement representation 1 1110010
Arithmetic Addition
• The addition of two numbers in the signed-magnitude system follows
the rules of ordinary arithmetic. If the signs are the same, we add the
two magnitudes and give the sum the common sign. If the signs are
different, we subtract the smaller magnitude from the larger and give
the result the sign of the larger magnitude.
Floating-Point Representation
• The floating-point representation of a number has two parts. The first
part represents a signed, fixed-point number called the mantissa. The
second part designates the position of the decimal (or binary) point
and is called the Exponent. The fixed-point mantissa may be a
fraction or an integer.
For example, the decimal number +6132.789 is represented in floating-
point with a fraction and an exponent as follows:
• Floating-point is always interpreted to represent a number in the
following form:
Fraction
• The fraction has a 0 in the leftmost position to denote positive. The
binary point of the fraction follows the sign bit but is not shown in the
register. The exponent has the equivalent binary number +4. The
floating-point number is equivalent to

Normalization
• A floating-point number is said to be normalized if the most
significant digit of the mantissa is nonzero.
Other Binary Codes
• Gray Code : The Gray Code is a sequence of binary number systems,
which is also known as reflected binary code.
Error Detection Codes:
• A parity bit is an extra bit included in binary message to make total
number of 1’s either odd or even. Parity word denotes number of 1’s in
a binary string. There are two parity system – even and odd parity
checks.

You might also like