Answer the question
In order to leave comments, you need to log in
How does a processor execute instructions?
How are instructions executed in a processor?
I know the circuit of a simple computer. Its elements, ALU, registers, cache, decoding commands, breaking them into elementary operations (about them and how are they performed?).
Take the JNE (jump not equal) command. To execute it, the processor must take the result of cmp and send $eip, the program counter (motor), a new pulse equal to the label.
As the motor calculates how many pulses it has received, it either needs to be connected to the ALU, or its own pulse counter must be built in. And that's just 1 team. How will the processor understand what to do when it receives another command, PUSH for example (its binary code, conditionally 11110000) ?
If you hard-code ~400 x86 commands, you get a very complex architecture. Therefore, there must be some kind of interpreter, which I heard about, but could not find information. It turns out recursion, a command interpreter for assembler commands.
If someone knows books on the topic "how to assemble a computer from transistors and install a simple OS there", then I would be grateful.
I read Tanenbaum's books and "Code, the secret language of computer science", I did not understand everything.
I apologize that everything is mixed into porridge.
Answer the question
In order to leave comments, you need to log in
there is a hardware decoder / decoder of commands , it converts the command opcode into physical "impulses" running along the wires and controlling the operation of the "iron" modules of the processor.
in modern processors, in order not to inflate the command decoder (in some x86 it began to occupy almost half of the crystal), they use a command translator that cuts x86 commands into a set of simple commands of the risc processor and sends them to be executed on iron risc processors.
the translation is determined by the microcode and the operation of the processor can be changed by changing the microcode.
The author wrote "I know the circuit of a simple computer". Perhaps he meant that he saw a picture or a diagram.
The device of the processors is studied in the courses of systems engineering. And they study them not from assembler, but from the logical elements of conjunction-disjunction-inversion. Encoders-decoders multiplexers-demultiplexers. triggers. General electronics course.
In general, the author google the following tags: Electronics. System engineering.
There will be a deep dive. deep dive.
And so from a raid and from a swoop. After reading about the assembler - you can not understand how the CPU works. The same as "driving a car" - you can not understand the principle of operation of a diesel engine.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question