5

Can anyone help me with this theory about microprocessor, cpu and computers in general?

( I used to love programming when during school days when it was just basic searching/sorting and oop. Even in college , when it advanced to language details , compilers and data structures, i was fine. But subjects like coa and microprocessors, which kind of explains the working of hardware behind the brain that is a computer is so difficult to understand for me 😭😭😭)

How a computer works? All i knew was that when a bulb gets connected to a battery via wires, some metal inside it starts glowing and we see light. No magics involved till now.

Then came the von Neumann architecture which says a computer consists of 4 things : i/o devices, system bus ,memory and cpu. I/0 and memory interact with system bus, which is controlled by cpu . Thus cpu controls everything and that's how computer works.

Wait, what?
Let's take an easy example of calc. i pressed 1+2= on keyboard, it showed me '1+2=' and then '3'. How the hell that hapenned ?

Then some video told me this : every key in your keyboard is connected to a multiplexer which gives a special "code" to the processer regarding the key press.
The "control unit" of cpu commands the ram to store every character until '=' is pressed (which is a kind of interrupt telling the cpu to start processing) . RAM is simply a bunch of storage circuits (which can store some 1s) along with another bunch of circuits which can retrieve these data.

Up till now, the control unit knows that memory has (for eg):
Value 1 stored as 0001 at some address 34A
Value + stored as 11001101 at some address 34B
Value 2 stored as 0010 at some Address 23B

On recieving code for '=' press, the "control unit" commands the "alu" unit of cpu to fectch data from memory , understand it and calculate the result(i e the "fetch, decode and execute" cycle)

Alu fetches the "codes" from the memory, which translates to ADD 34A,23B i.e add the data stored at addresses 34a , 23b. The alu retrieves values present at given addresses, passes them through its adder circuit and puts the result at some new address 21H.

The control unit then fetches this result from new address and via, system busses, sends this new value to display's memory loaded at some memory port 4044.
The display picks it up and instantly shows it.

My problems:
1. Is this all correct? Does this only happens?

2. Please expand this more.
How is this system bus, alu, cpu , working?
What are the registers, accumulators , flip flops in the memory?
What are the machine cycles?
What are instructions cycles , opcodes, instruction codes ?
Where does assembly language comes in?
How does cpu manipulates memory?
This data bus , control bus, what are they?
I have come across so many weird words i dont understand dma, interrupts , memory mapped i/o devices, etc. Somebody please explain.

Ps : am learning about the fucking 8085 microprocessor in class and i can't even relate to basic computer architecture. I had flunked the coa paper which i now realise why, coz its so confusing. :'''(

Comments
  • 2
    For that detail level, devRant isn't a useful platform because comments aren't e-books. I suggest that you first read what Wikipedia has on the keywords, that is usually a good starting point.
  • 0
    And when you know all this shit? What will you do with this knowledge?
  • 3
    I recently watched and quite enjoyed the Crash Course Computer Science on YouTube. It might appear like it’s aimed at kids maybe, but it’s quite a good explanation in my opinion.

    https://youtube.com/playlist/...
  • 0
    @JackToolsNet well from the college pov, i get to pass without mugging .
    And from the career pov , i might get my basics cleared and maybe get interested in learning more about semiconductors and microchips which is quite a booming industries these days, with pioneers like Samsung and Qualcomm wanting people with such knowledge.
  • 0
    @Fast-Nop well i tried , there is a ton lot of things on wikipedia too, but I seem to get even more confused.
    I thought maybe devrant could help me get a basic vision of how things are working, it has always been the best platform for 1 to 1 help
  • 1
    @TitanLannister well sounds like a good reason.

    Much fun and good luck
  • 1
    @joycestick am on it. Watched first 2 vids, it looks like its going more into all the history of computers and other basics, but i am liking this knowledge.
  • 0
    @TitanLannister It starts off that way, and from memory it always gives the history along with the development. Stick with it. I’ve not tried building my own memory out of transistors yet, but it’s on the list! Hope you enjoy it.
  • 0
    @TitanLannister the problem is the scope. That would be several semesters of EE or hardware CS.

    It's basically learning a tech stack, and you can either learn bottom-up, i.e. from simple transistor logic towards the software, or the other way around. Learning all at once will give you many dots, but connecting them will be difficult - that's why you feel lost.

    Given that you have already C in your skillset, which is one level above assembly, I would start from the software end because that's something you can relate to. So, delay the transistor, flip-flop etc. stuff for a while.
  • 0
    Wow that is a shit ton of things for a begginer. I recommend understanding a simpler example for now and after that you can expand that. (but i dont know any good sources now... besides my minecraft cpu, it is a good example but it needs more descriptions i think 🤔)
  • 0
    Assembly is what instructions a CPU has. Unlike C, that's specific for each CPU. Assembly usually means the symbolic names of the instructions, the mnenonics, for a human programmer. The "real" binary stuff is the machine code.

    Registers are small memory right inside the CPU, usually 8, 16, 32 or 64 bits wide, depending on the CPU. The CPU can do immediate operations on the values there without waiting for slow main memory. For example, it can add the values of two registers, that's what the ALU part does - arithmetic and logical unit.

    An accumulator is a special case of a register for CPUs that can't mix their registers in all operations nilly-willy.

    An interrupt means that the CPU interrupts whatever it is doing and does something else, e.g. incrementing the system time.
  • 0
    DMA is direct memory access. Instead of being busy with loading stuff from memory into the CPU and writing it to other parts of memory, some CPUs can do that in parallel to their other operations.

    Memory mapped IO devices are just a special memory address. In C, you would cast an integer constant to a pointer and read/write there. The CPU thinks it's memory, the software also, but in fact, there is e.g. a serial port at that address. Instead of storing a value written there, it is transmitted on the serial interface.
  • 0
    @joycestick BELIEVE ME I CAN'T THANK YOU ENOUGH!!! All i wanted was a visualisations of how the modern system works and the playlist actually went in it!!! The videos 5th to 9 gave me a very good image to visualize how a processor is able to perform operations on data. Its actually all 0s and 1s stored on memory, even the instruction codes!!. Those animations on ADD M to 1101001 and how cpu rjnd the fetch load execute cycle with the help of clocls...mann that's the stuff! Thankyou so much!

    I feel like running outside my home shouting "EUREKA! EUREKA!" 😅😂

    Although am currently learning about 8085 and it didn't went into topics like DMA or MMIO, i think i can pretty much walk into it with a better knowledge than before.

    Can you recommend some other video series like this for topic about communication systems: digital and analogical, the one involving ugly fourier series sine cos graphs, modulations, etc? I don't wanna mug that subject too
  • 0
    @Fast-Nop thanks for this info . I actually knew about the mmio, and not much about dma/opcodes, so learnt something new. Would be looking more into it, since now am having some knowledge about von Neumann and basic 4004's working in general.
Add Comment