Microprocessor Logic
Evry day we use computer and we can't do a job withouth computer, but did you know how does processor/ microprocessor work.??.
To understand how a microprocessor works, it is helpful to look inside and learn about the logic used to create one. In the process you can also learn about assembly language -- the native language of a microprocessor -- and many of the things that engineers can do to boost the speed of a processor.
A microprocessor executes a collection of machine instructions that tell the processor what to do. Based on the instructions, a microprocessor does three basic things
Using its ALU (Arithmetic/Logic Unit), a microprocessor can perform mathematical operations like addition, subtraction, multiplication and division. Modern microprocessors contain complete floating point processors that can perform extremely sophisticated operations on large floating point numbers.
A microprocessor can move data from one memory location to another.
A microprocessor can make decisions and jump to a new set of instructions based on those decisions.
There may be very sophisticated things that a microprocessor does, but those are its three basic activities. The following diagram shows an extremely simple microprocessor capable of doing those three things:
Although they are not shown in this diagram, there would be control lines from the instruction decoder that would:
Tell the A register to latch the value currently on the data bus
Tell the B register to latch the value currently on the data bus
Tell the C register to latch the value currently output by the ALU
Tell the program counter register to latch the value currently on the data bus
Tell the address register to latch the value currently on the data bus
Tell the instruction register to latch the value currently on the data bus
Tell the program counter to increment
Tell the program counter to reset to zero
Activate any of the six tri-state buffers (six separate lines)
Tell the ALU what operation to perform
Tell the test register to latch the ALU's test bits
Activate the RD line
Activate the WR line
Coming into the instruction decoder are the bits from the test register and the clock line, as well as the bits from the instruction register.