[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

I know this is not /wsr/, sorry!

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 16
Thread images: 1

File: Harvard_architecture.svg.png (65KB, 2000x1272px) Image search: [Google]
Harvard_architecture.svg.png
65KB, 2000x1272px
Hey guys, I have been studying technology ( Electrotechnology) For three years now and to be honest I don¨t know shit. All my basics are mixed up and now I¨m failing my class.

Since I live in the Czech Republic, the scholarship system is a lot different from the US, UK and CAN ones. ( https://en.wikipedia.org/wiki/Education_in_the_Czech_Republic )

Anyways, right now I'm at the end of my third year at the Secondary technical school and I am failing my Microprocessor technology class (MIT). I have pretty much all the basics mixed up. Some of the questions are definitely going to sound retarded but here goes nothing.

1. In the Harvard μC, where are the registers located and what is their purpose? I know it has CPU, ALU, Bus, an oscillator, interruption, SRAM, EEPROM, Timer, I/O and UART (Which i have no idea what that is). Where are the registers located? I know EEPROM should be for program data so what is SRAM for?

Thanks in advance. Also there will be more retarded questions to follow since I am currently going through my friends notes and styding for Thursday when I'm gonna be examed.
>>
>>55204677
>SRAM
Stands for Static Random Access Memory. It's standardly used as processor cache. "Normal" computer RAM is Dynamic Random Access Memory, or DRAM.

The CPU registers are the final location before data and instructions are processed together to return a result. In very layman terms, a computer takes a task from a program stored on the hard drive, puts that task into RAM, then it's put into the processor cache and finally the registers. Look up memory hierarchy for more on this.
>>
>>55204793
Thank you very much for shedding some light on this man!
>>
>>55204816
No problem, I'm a student aswell, Computer Engineering. Hope you ace that exam!
>>
The registers are the memory built into the CPU that the ALU works on directly.

The SRAM is used as working memory for the program, as you can't fit everything just into the registers.

On modern microcontrollers EEPROM is usually used to store configuration data, flash memory is used for storing the program because it's cheaper.
>>
Also, what is a stack pointer? I did some programming in Assembly and I use Stack pointer there a lot but I still have no idea what it's for.
>>
>>55204834
Thanks man, it's a life or death situation
>>
>>55204883
The stack pointer is a value stored in a dedicated register that points to the memory address at the top of the CPU stack. More on this: https://en.wikipedia.org/wiki/Stack_(abstract_data_type)#Basic_architecture_of_a_stack
>>
>>55204940
Oh okay, and what is a stack then? I can't really wrap my head around it. Is it like a collection of data that needs to be used in a certain order?
>>
>>55205008
I mean I get the idea, but what is the purpose? Why can't I just store something somewhere and then just read it?
>>
>>55205008
Yes. It follows principle called LIFO (last in, first out).

So say I have a stack of these words:

apple
banana
coconut

If I push "blueberry" onto the stack (push is the actual name of the operation, by the way):

blueberry
apple
banana
coconut

The pop operation removes the object at the "top" of the stack. "Popping" the stack above would remove the "blueberry" entry, because it was the last to go in, therefore it will be the first to go out (LIFO).

Another thing about stacks, the "top" of the stack will have a lower memory address than the "bottom". It's sometimes called "inverted" stack. This image illustrates it well: https://en.wikipedia.org/wiki/Stack_(abstract_data_type)#/media/File:ProgramCallStack2_en.png
>>
>>55205037
Oh okay, so if I used the Stack pointer to point to "17" i would be operating the 17-20 stack? (In the picture)
>>
>>55205057
Or is it a one huge stack?
>>
>>55205033
About purpose, it can be useful for certain things. Imagine a chat client. The simplest way to make a basic chat client would be to have a stack of messages.

Have you studied recursion yet? It's a programming concept in which a function calls itself to accomplish a task that needs to be repeated multiple times. In recursion, the stack actually stores each one of the recursive function calls, and when it reaches an end condition it starts popping the calls one by one.

>>55205057
Correct. That range is just a portion of the stack.
>>
>>55205101
Oh okay, thank you very much.
>>
I'm interested in learning more about how CPUs and memory work. Can any one suggest a book or resource? It bothers me that I only have a general idea of how my computers work.
Thread posts: 16
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.