Hello friends, welcome to Gate Smashers In today's video we are going to discuss different types of registers. Before starting the video,
I want to tell you one thing That computer organization has always been a tricky subject for students. Because we discuss hardware
and software both in this And students try to cram these concepts And because of that they are
lacking in this whole subject But in all the videos I am bringing In these we'll discuss the concepts
one by one in sequential order With which you will get total clarity That how actually the
hardware and software works. In the last video we discussed How we connect registers with the common bus And how we implement
the common bus with the help of multiplexers Do check that video once Because you will get an idea from it That what we are talking about, about
registers or different types of registers Before that you should know how we connect them How the circuit actually looks like Here we are talking about
different types of registers In which we first of all
talk about address register Data register, accumulator, program counter Instruction register, temporary
register, input and output register Now their size, how big
is the size of this register Generally the registers
in our system are 16 bit Or they can be 8 bit or 32 bit But generally we use 16 bit registers Now these registers are basically
sequence of bits or flip flops But how their size matters how do we measure their size
that depends on this concept So first of all if you
talk about memory we are talking about
the memory which is RAM That is 4096*16 We have taken a very small size so
that you will get to know about this concept So if we talk about memory 4096 So what is 4096 It is number of words Number of words if you are talking about
a particular memory If we talk about this memory here Then how many total
number of words we will have. Total number of words, now how
many bits we can store in that word Means the size of the word Now I will tell you what this word is In operating system we
generally talk about block But in computer organization we
use this word a lot that is a "word". Now what is word actually It is a memory representational unit
Means to represent memory We use word, although we use
byte You must have heard about byte That memory is byte addressable
But byte is actually a fixed number One byte is equal to 8 bits But today we are using operating
system 32 bits, 64 bits So the size of the word is not limited
to 1 byte it can be 2 bytes or 4 bytes Means multiple bytes
can also be a word if we talk about memory
in real life scenario Then it is word addressable
So what is word here That how many words
we can store in memory That is called the number
of words, that is 4096 And how many bits can come in every
word Means total size of that word is 16 And 16 means, bits
Which you can call 2 bytes Means in our example
One word is 2 bytes You can also call it like this
Now if we talk about 4096 So 4096 means number of words we have 2 raised to power 12 You can write it as 2 raised to power 12 Because how we will give it
numbering like this 0 0 0 0 0 Means 12 number of 0 Then 0 0 0 0 0 0 1 By doing like this at the end 1 1 1 1 1 1 Means continuously 12 "1" And in this way we will provide
an address to all the words And we have to
keep in that word 16 bits So 16 bits means
2 raised to power 4 You can mention it in this way also Now we will talk about address register What is the use of address
register With address register We actually pick up data in memory
the words in memory Now let's say I have to pick up
data from a particular address That address we have to give to memory That brother pick up the word
from this particular location From this particular
value pick up the instruction from there
So how will it happen For that we have to
mention address here And that address will
be in address register And with address register we
will give that address to memory Memory will decode it And after decoding it will go to that
particular location and fetch the data This is actually the work of address register So if we ask you what will
be the size of address register According to this example
what will be the size of address How many number of words we have 12 2 raised to power 12 Means from 0 to 11 So what will be the
total number of size Total size of address
register will be 12 bits Simple how many values
are we representing address 2 raised to power 12 means
12 values are represented So address register
will be of how many bits? 12 bits. Here from 0 0 0 0 to 1 1 1 continuously Any value can exist between 12 and 1 Then data register, from the name we
are getting to know that data register means Where we store data Means where we bring data
Now what are we putting in data register And what is the size of data
How many bits can come here How many bits will be in a word. In a whole location we
told the size of a word is 16 So these can be 16 bits So
what is the total size of the address 0 to 15 means Total size
of data register will be 16 You can ask here in this way And you should know this
Because this is a very basic point We will use them later
Will try to design the computer And how all these registers
are connected to each other With ALU and how they are connected to each other We will see that in the next video So that you can know How we fetch
the instructions How ALU executes How we keep the data temporarily on
the way You will know all these points there But these points will tell
you What are the registers How we measure their size Accumulator What is the use of the accumulator here We use the accumulator
To store intermediate data Means if data comes from ALU we keep it In the accumulator
Means in the intermediate Like we are converting
the input to the output So if I have to store any
particular data for a while Then we can store that data in the accumulator
We picked up the data from memory After fetching the data from
memory We have to give it to ALU So what can we do before that We
can keep it in the accumulator for a while So what are we keeping in the accumulator Data, So what is the size of the data According to this example, 16 So what is the accumulator From 0 to
15 bits Means total number of bits is 16. Program counter
Program counter is basically we use to store the address of
next instruction Means let's say that our instruction is I1 And I1 instruction is at 1000 address
At 1000 number address So what is program instruction With our program counter
we fetched this instruction As soon as we fetched this instruction
So what is this whole area It is empty So where is the next instruction
Next instruction is at 1001 Which instruction is that I2 So here the program
counter that I have Program counter always
points out that location Where the instruction is. Not where we picked up the instruction
from This is always the next instruction Where the instruction
is It will always store that particular address If we talk about this scenario currently we had already taken out the
instruction from 1000 So where is the next
instruction In 1001 Means what will be the
value of program counter 1001 Means this point is basically telling Where our instruction is now we picked up from here. As soon as we picked
up the instruction from here So where is the next instruction Let's say at 1002 So all these 7 will change to 1002 So wherever your
next instruction is That address is in the program counter So again what am I saying here Address
What are you keeping here Address the next instruction location
or address of that place And address we have already told That how many bits are used to
represent the address 12 So what is the program counter From
0 to 11 bit Or which you can simply say 12 bits Program counter. Then instruction register this is main Because what we have to do actually
We have to execute the instructions What ALU has to do, stored the
program, execute that program So what do we have in memory
we discussed in Von Neumann's architecture Stored memory architecture
Where we keep instruction & data in same memory So what happens is that our memory in that memory Instruction is stored
Instruction means let's say the format of
instruction you see first In the format of instruction
we have an opcode And the second is operand What are the LSB bits showing Operand means data Opcode is telling
What operation you have to perform Means you have to do addition,
subtraction Multiplication different types of Opcode operations will be here and where is the data That will be on operand
So let's say if I write here I write add, and here I wrote 450 So what will happen
What does it mean what instruction we took from there
what should we do there One is addition and 450 is telling
Where operand is stored Means your data is stored in memory
But at which location 450 location So you go to 450 location And fetch the data from there the entire format of instruction Both these things are important
That is opcode and operand Operand from where
you have to pick up data That particular address
And what is opcode What operation you
have to perform But I have written one
more thing, i The last MSB is most significant bit We keep one bit
here Either 0 or 1 0 represents direct address And
1 represents indirect Addressing We will discuss about this in
detail in next video But a little idea Like we discussed
this example according to that Let's say I wrote add And here 450 Now here if I have this bit
Which is msb If its value is 0 Means Direct address
Means you go to 450 location Whatever data is there pick up
that data And give it to accumulator So what is this thing telling me? It is telling address where
data is there And it is telling Direct, means as
soon as you go there You will get your data
But if its value is 1. Means what is this? Indirect Addressing Means you have
to go to 450 first When you go to 450 On that location It
may be written 1002 Means what is this? Address, now you have to go to 1002 What will you get by going there? Address These are
different types of addressing modes Which we will
see in detail next Now what you have to do What
we are doing in instruction register We are storing the
whole instruction here And instruction in
our case Again 0 to 15 Means total 16 bits
What is operand? Now I have told you address that go to 450 location
Go to this particular location So you know the location is 12 bit
Because number of words we have According to our example 4096 So 12 is representing operand
value here And the other 3 Because this bit is
representing Direct and indirect So the remaining 3 bits
here That is what? Opcode And what is that opcode? Addition,
subtraction Multiplication, division What you have to do? Which operation
You have to perform here? So this basically is the format of instruction register And this instruction will
come in instruction register what will be the size of
instruction register? 0 to 15 That is 16 bits So in this way The value of registers
The size we measure Next comes temporary register Temporary register
means The one we use to store temporary data
Again here data is stored So means 0 to 15 means 16 bits size
Then we have input register Input register is To pick
up data from input devices Means you typed something from
keyboard So we pick up data from there And put it in input register and give that data to ALU
From input register Or in accumulator so input
register It has nothing to do with this Where does it take input? It takes from
input devices So in our case you take it Simply 8 bits for simplicity You can increase it That is
it has nothing to do with this the data taken from
input devices And such output register Obviously
what we have to represent is output From where will it pick up data? It will pick up output
register from ALU Now who has to be given that output? We have to give that output to output
devices Like printer, scanner, monitor So to give that we use output register So these are basic registers Which we use but How
is their connectivity? How do we use this in sequence? And how is the instruction fetched? Decoded? How do we convert it in output? We will see this in next video
Here you have just given a basic idea What are different types of registers? And how do we measure their sizes? Thank you.