Tuesday, May 24, 2022

Word size and Bus Widths – A Level Computer Science

Right mr. Palmer here doing the second video on CPU performance and this one's about words on bus with okay so the big question basically is how does word size affect the ability of the CPU to perform tasks now remember the purpose of a CPU is to flex decode and execute instructions what is fetch entail we need to get data .

From some form of memory address data or instruction a binary is going to zip down the bus okay and then in order to execute instructions again we need data okay so we've got the CPU on one side which once they fetch decode execute we've got the RAM on the other side which contains that the programs and the data that are currently in use so how do .

The requests get to the RAM and the date I get back to the CPU basically we have two buses that were concerned about in this particular video okay the address bus and a data bus so the remember the CPU will send the address that is interested in down the address bus turn around okay and then the see the RAM will return whatever value is stored in .

That location back to the CPU you can see in this video my address bus has got three lines okay each so that and that's basically all a bus is it's a collection of lines which are the wires okay between one component and the other component each wire can carry only one signal on or off and that's why that that address bus for .

Example we can say it's three bits wide because it's carrying the three bits 0:01 so likely likewise the data bus is two bits wide and because it's got two lines in it alright so if I think about that address bus it's got three lines that bus with the three bits therefore I've only got two to the three permutations range of values of zero to .

Seven basically what I'm saying is I can only address up to eight memory locations to each location carry had like a bite in it I can only actually address eight bytes of memory okay if I increase the width of the address bus well obviously I'll be able to address a wider I'd have a wider range of possible addresses and I can address more memory .

So I want you to do is only to hit pause and I want to do the same calculation for 16-bit and 32-bit see if you get the same result as in a minute and figure out what what you might actually have to send if you had those worth of address buses okay so I'm assuming you've pressed play again and with a 16-bit address bus I had to to .

The 16 which is 65536 possible addresses so I'm going to divide by 1024 too and assuming that each mail box contains one byte that basically means that I've got 64 K of RAM that I can address okay the same thing with a 32-bit bus 2 to the 8th 2 gives me 4 billion 294 million blah blah blah ok and if I divide by 1024 to get the note in kilo bytes and .

Then I got 1024 again to get megabytes and 1024 again dividing that gives me 4 gigabytes of ram assuming each mailbox is throwing a byte of data okay so what about a data bus basically the same thing applies all right the wider bus equals more permutations so in the previous example I had two lines 2 2 2 2 is 4 .

Okay 0 1 2 3 they're all there the only values that I can transmit that's a bit crap because that basically means that I can't really transmit large values down the bus if I had a 16-bit address bus ok I'll be able to transfer two bytes at once so what can you actually transfer in 2 bytes if you think about it to ASCII characters or a single Unicode .

Character okay that's not a lot so if we try and relate this now to machine code and assembler alright remember if you have an instruction and we break it down into the opcode and an operand okay that whole thing needs to be transferred down the data bus okay between the CPU to the to the from the RAM down to the CPU so if I have a 16-bit bus I'd be able to .

Transfer a 16 bit binary string containing opcode number bit or the addressing mode and the operand down to the CPU okay that means if I had 6 bits for the opcode I'd only be able to transfer 64 possible instructions and if I kept a byte okay then basically I don't have to transmit a maximum value of 255 or if I .

Was transferring characters again thinking about a previous example it's one ASCII character at a time potentially okay not a lot so sixteen bits as you can see is not particularly useful that's why you know that up till recently we were using 32-bit CPUs and then basically nowadays we're all using 64-bit CPUs so the Intel Core i7 use .

Those 46 bits to address the memory okay so it's quite a 64-bit bus take out two bits so you've got 46 bit for the memory two bits for the addressing mode and then the rest of it is for the instruction opcode okay so with 46 bits to address memory basically you should be able to work out how much memory an intel core i7 would be able to address .

It's quite a large amount alright so you've basically been able to see how increase in the word size in this video so in this video increasing the word size of the address bus means that the CPU is able to address a larger amount of memory and work with that memory and by having a larger word size in a data bus you can transfer larger strings of .

Data to the CPU okay and that's it


Most Popular