How does memory work in a computer system? We talk about cells, information stored in those cells, addresses, sizes and how data gets stored in memory.
stumbled across this vid while studying for my college exams and i really like how simple the presentation of the topic is. It really helped me organize this information in my mind. Great work!
Thank you for the very detailed explanation. However, isn't it that there is the null character or string terminator at the end of the string "Hello" and this also occupies an address in the memory?
thanks for your explanation, but actually 8 in binary doesn't equal 1011, but 1000. 1011 is equal to B. Sorry to say, but Iwas so proud to notice this tiny mistake! Great job.
Suppose if we have to store a 2 byte integer then it will take two cells say 1312 and 1313 . But in programming if we want to print the address of this integer then what would be printed.. Whether it will print 1312 or 1313???
Nice vdeo. How are the memory address's stored in ram using your 1 byte per cell example? On a 32 bit system would a single memory address use all 32 bits which would equal 4 four byte cells as, per your example?
I am not shure if i understand your questions. For to access one byte of ram we can use an address register where the memory address is already placed before. So we can start to write the address that we want to use into a address register example with a move instruction with two operands of one target register and one source operand containing an imidiate value that represent the address, so that the address is only placed inside of our instructions example with a length of 32 bit divided into 4 addresses as a part of our instruction. If an address register is already loaded with an address, then we can access the data of the address example with a move instruction using the address register. This instruction only contains the used register for to address a memory location and additional it contains an other operand as a destination or as a source, depends if we want to load or to store a value from or to the ram. Additional relative addresses are also exist as a forward or backward reference for addressing from the current location, example for to branch to an address. And this address is only stored as a relative address value to our current instruction. So that the address unit of the CPU have to add or to sub the relative address to the address of our current instruction, without to store the fully 32 bit address in the ram.
Nice, your way of teaching is really great. But i have one doubt. Does the integer numbers are straightly stored into the memory cells or the binary of that integer will be stored? For example i wanna store 21 in a cell, Does the system will store 21 into the memory cell or it will store 00100001 in the memory cell?. Thank you!
+Albert Karuna yes you have to count in binary. this person has started with undue complexity and never gets to actual information on seagate drives or the tiny usb memories. each memory has an address in binary. say location 0000 0000 . set your switches to zero. or press reset. 21 in binary is 16 + 4 +1 or 0001 0101 . now what address do you have to put 0001 0101 at ? Each memory chip has an address and data bus. For a typical microprocessor (170 instructions) the address bus has 16 wires that go from about .1 volt (low or zero) to 4.7 volt (high or 1). The microprocessor counts to 0000 0000 and reads the instruction there. I would put a jump command of 1100 0011 in a ROM . Then put 0000 0000 and 0000 0000. The microprocessor will loop around to address location zero.
sir please tell me !! where is the memory addresses stored ! by this i mean that every memory cell has a address e.g #123abc but my question actually is where is this #123abc stored?
if in a 32 bits CPU the memory address is of 32 bits and assuming the that the size of each cell is of 1 byte the the maximum memory the computer can handle is of 4.294 * 10^9 = 4 gigabytes, how do then computers can handle a USB flash memory bigger than 4 gigabytes?
You are partly right , 32 bits CPU can handle only 4 gigabytes of data.But CPU takes the data from RAM not the flash memory.Thats why most RAMs we see are of 4 gigabytes.
EddyCr Applying power to a flip-flop circuit, such as is used in "static" memory chips, has a 50-50 chance of locking into either of the two stable states, just as dropping a coin edge down on a table gives the coin an equal chance of landing with either side up. The cheaper and more common "dynamic" memory has a small chance of retaining its prior contents if power has been off for a VERY short interval, but more commonly it would power up with binary zeros, since each bit is a very small leaky capacitor, which has to be "refreshed" periodically to keep the bits in which 1s are stored from leaking down to 0s before their information is needed again. Motherboard circuits lock out access by the CPU a few thousand times per second to give each bit cell in a row the refresh signal. This slows down computation by about one in a million CPU cycles at most.
BTW, one hex digit is made of 4 bits. 0xF = 0b1111. 0xF = 15 oranges, 1001 = (look at bits position: 1 + 0 + 0 + 8) = 8 oranges. We can even see the numbers as colors, so a given color can mean 73 oranges if your like. It is all just an abstraction of a number/digit, that represent some value/quantity, so use need to use your imagination. Look here how to quickly convert: www.permadi.com/tutorial/numDecToHex/
This is probably a stupid question, but to find the total number of cells, why is it S - 1 and not S + 1? Since the cells start at zero, then wouldn't you tack a cell on to account for cell zero?
I'm assuming in this 10 months of period, you would've already figured out the answer, but still, in any cases if you're still wondering, here is the answer.. consider like the whole memory have only 10 cells, now start address from 1 to 10.. since the total cell count is 10, it should be easy to address them all. now, with the same scenario, start the addressing with 0, now remember, we have only ten cells, so that the addressing number will be end at 9.. (0...9 -> 10 items). Now that total memory cell count is S (any natural number). so that last index should be S-1 only. Total no. of cells wouldn't be S-1 or S+ 1, its just S.
#import #import #import is the way you want to go. You should work with these and really only use pointers by yourself if you know what you are doing and how it pimps the performance. When it comes to pointers you have to delete the allocated memory. Otherwise it comes to leaks. I would use these containers, since they came with the last standards and manage the memeory allocation and deallocation mostly themselve. There are some exceptions tho. They come with some useful functions as sort, size, max_size - you will see, if you invest like 20 minutes and google them. Oh and if you need an dynamic array and things like thatcheck out #import closely. It is really nice
stumbled across this vid while studying for my college exams and i really like how simple the presentation of the topic is. It really helped me organize this information in my mind. Great work!
love your way of teaching,thank you,thanks so much!!!
Thank you very much sir ! Great job. From the first minutes i've understood what i didn't in the class.
Very clearly explained, thank you!
Well done!! I like the way you explained everything.
Great video man, I enjoy your style of teaching.
Thank you, very intuitive explanation!
Very effective and elaborate style of teaching. Thankyou Sir!
Thanks for the presentation, it was nice to remember
Realy like this video, briefly and clearly, excellent job.
Very well explained!
thanks for a simple explanation
Beautiful explanation of the concept. Well done sir.
Awesome. love ur patience
Very clear sir, thank you so much for the video!
Great explanation.
thank you very much sir.
This helped a lot . Thank you very much ❤
Sir ur teaching is beneficial to us so plz continue by making such videos in all topics
Excellent lecture!
Thank you soo much brother.
This is awesome!
best tutorial seen on youtube
crystal clear explnation! the best video out there :)
Thank you very much teacher
Thanks you so much
Excellent !
really good, i got my stizzy, and listening. thank you for exlaining
This video is a gem 😍 Thankyou
Thank you very much :)
Well explained.....thank u sir
really clear explanation, thank you sir. we are waiting FPGA videos
this video costs a 100000 thumbs upss...👍👍👍👍...
Clear explainatiin sir , thank you
THANK YOU!
Decent explanation
great work sir.. please help us with instruction sets... and types of division like restoring and non restoring
PERFECT!!!!
Thank You
genius
should get a nobel prize for clarity
Thank you for the very detailed explanation. However, isn't it that there is the null character or string terminator at the end of the string "Hello" and this also occupies an address in the memory?
thanks for sharing Abelardo Pardo
thanks for your explanation, but actually 8 in binary doesn't equal 1011, but 1000. 1011 is equal to B. Sorry to say, but Iwas so proud to notice this tiny mistake! Great job.
your english is simple for me from brazil understand, you can be teach of english that will have success.
شكرأ
Suppose if we have to store a 2 byte integer then it will take two cells say 1312 and 1313 . But in programming if we want to print the address of this integer then what would be printed..
Whether it will print 1312 or 1313???
Nice vdeo. How are the memory address's stored in ram using your 1 byte per cell example?
On a 32 bit system would a single memory address use all 32 bits which would equal 4 four byte cells as, per your example?
I am not shure if i understand your questions.
For to access one byte of ram we can use an address register where the memory address is already placed before.
So we can start to write the address that we want to use into a address register example with a move instruction with two operands of one target register and one source operand containing an imidiate value that represent the address, so that the address is only placed inside of our instructions example with a length of 32 bit divided into 4 addresses as a part of our instruction.
If an address register is already loaded with an address, then we can access the data of the address example with a move instruction using the address register. This instruction only contains the used register for to address a memory location and additional it contains an other operand as a destination or as a source, depends if we want to load or to store a value from or to the ram.
Additional relative addresses are also exist as a forward or backward reference for addressing from the current location, example for to branch to an address. And this address is only stored as a relative address value to our current instruction. So that the address unit of the CPU have to add or to sub the relative address to the address of our current instruction, without to store the fully 32 bit address in the ram.
way of ur explanation is awesome..but the ascii value for H is 68 not 48(in string operation)
how 68 ??
What;s the use of hexadecimal? Seems to just add confusion...
man.. you're great at explaining but your esssses (s sound) is so sharp. i appreciate your lesson though..
Nice, your way of teaching is really great. But i have one doubt.
Does the integer numbers are straightly stored into the memory cells or the binary of that integer will be stored?
For example i wanna store 21 in a cell, Does the system will store 21 into the memory cell or it will store 00100001 in the memory cell?.
Thank you!
The cells store binary numbers. If the cell has eight bits, 21 is stored as 00010101
Abelardo Pardo Thank you sir.
+Abelardo Pardo . . . and if 21 is a string, it'll be stored in two cells (assuming each cell is 8-bit), am i right?
+Albert Karuna yes you have to count in binary. this person has started with undue complexity and never gets to actual information on seagate drives or the tiny usb memories. each memory has an address in binary. say location 0000 0000 . set your switches to zero. or press reset. 21 in binary is 16 + 4 +1 or 0001 0101 . now what address do you have to put 0001 0101 at ? Each memory chip has an address and data bus. For a typical microprocessor (170 instructions) the address bus has 16 wires that go from about .1 volt (low or zero) to 4.7 volt (high or 1). The microprocessor counts to 0000 0000 and reads the instruction there. I would put a jump command of 1100 0011 in a ROM . Then put 0000 0000 and 0000 0000. The microprocessor will loop around to address location zero.
john halamka thanks...
Do the cells always have the same size? If not, does the formula still apply?
sir please tell me !!
where is the memory addresses stored !
by this i mean that every memory cell has a address e.g #123abc but my question actually is where is this #123abc stored?
is it basically an array?
i want some clarification.
how can a common man analyse that memory is stored in a small piece of metal ..the data may be photo,viedos.. etc
if in a 32 bits CPU the memory address is of 32 bits and assuming the that the size of each cell is of 1 byte the the maximum memory the computer can handle is of 4.294 * 10^9 = 4 gigabytes, how do then computers can handle a USB flash memory bigger than 4 gigabytes?
You are partly right , 32 bits CPU can handle only 4 gigabytes of data.But CPU takes the data from RAM not the flash memory.Thats why most RAMs we see are of 4 gigabytes.
how is that garbage in the memory generated? where does it come from?
EddyCr Applying power to a flip-flop circuit, such as is used in "static" memory chips, has a 50-50 chance of locking into either of the two stable states, just as dropping a coin edge down on a table gives the coin an equal chance of landing with either side up. The cheaper and more common "dynamic" memory has a small chance of retaining its prior contents if power has been off for a VERY short interval, but more commonly it would power up with binary zeros, since each bit is a very small leaky capacitor, which has to be "refreshed" periodically to keep the bits in which 1s are stored from leaking down to 0s before their information is needed again. Motherboard circuits lock out access by the CPU a few thousand times per second to give each bit cell in a row the refresh signal. This slows down computation by about one in a million CPU cycles at most.
YOur two integers were 5689 and then you convert them into a binary number so how did you get 1639. at time 9:13
Sandy San Yes, I'm wondering the same. Can anyone explain that please :)
Its in hex decimal not binary
The first step was to convert the number into a binary representation then into HEX form.
Trevor Ohara-Oates Thank you
BTW, one hex digit is made of 4 bits. 0xF = 0b1111. 0xF = 15 oranges, 1001 = (look at bits position: 1 + 0 + 0 + 8) = 8 oranges. We can even see the numbers as colors, so a given color can mean 73 oranges if your like. It is all just an abstraction of a number/digit, that represent some value/quantity, so use need to use your imagination. Look here how to quickly convert: www.permadi.com/tutorial/numDecToHex/
im not that good at english but you are greate at teaching
At 8:01 it should be "0101= 5" at the beginning and not "0001= 1"
Are all information stored in hexadecimal notation in memory?If yes then why??
PLEASE ANSWER SIR
No, information is stored in binary. Hexadecimal is just a more manageable representation of the bits used by the machine.
@@AbelardoPardo
Thank you Sir for clearing my doubt.😇
This is probably a stupid question, but to find the total number of cells, why is it S - 1 and not S + 1? Since the cells start at zero, then wouldn't you tack a cell on to account for cell zero?
I'm assuming in this 10 months of period, you would've already figured out the answer, but still, in any cases if you're still wondering, here is the answer.. consider like the whole memory have only 10 cells, now start address from 1 to 10.. since the total cell count is 10, it should be easy to address them all. now, with the same scenario, start the addressing with 0, now remember, we have only ten cells, so that the addressing number will be end at 9.. (0...9 -> 10 items). Now that total memory cell count is S (any natural number). so that last index should be S-1 only. Total no. of cells wouldn't be S-1 or S+ 1, its just S.
ऐद्रेस
char arr[] = std::string
#import
#import
#import
is the way you want to go. You should work with these and really only use pointers by yourself if you know what you are doing and how it pimps the performance. When it comes to pointers you have to delete the allocated memory. Otherwise it comes to leaks.
I would use these containers, since they came with the last standards and manage the memeory allocation and deallocation mostly themselve. There are some exceptions tho. They come with some useful functions as sort, size, max_size - you will see, if you invest like 20 minutes and google them.
Oh and if you need an dynamic array and things like thatcheck out #import closely. It is really nice
Ur voice cause pain in ear
Can we not say or use little or big endian policy for alphabets..??