The CPU of the MCS-51 is made up of operational components and control elements
Arithmetic Parts
Includes ALU, bit processor, accumulator A, scratchpad, program status register PSW, register b
Accumulator A
A 8-bit accumulator, A's carry sign CY is also an accumulator for the bit processor
Register B
Perform multiplication and division operations, which can be used as normal registers when not executed
Program Status Register PSW
8-bit read/write registers, different bits contain different information of the program
PSW D7 6 5 4 3 2 1 0 d0h
- Psw.7-cy: Carry flag, when executing arithmetic and logic instructions, can be set or cleared by hardware and software, accumulator in the in-place processor
- PSW.6-AC: Auxiliary carry flag, perform addition and subtraction low four-digit to high four-bit or borrow, by hardware 1, otherwise clear
- PSW.5-F0: Flag bit, user use, software set-up removal
- psw.4.3: Register Area Selection Control bits 1 and 0, software write Rs1,rs0
- 00-Zone 0 Internal RAM register address 00h~07h
- 01 arr. 1 08H~0FH
- 10 arr. 2 10h~17h
- 11 arr. 3 18H~1FH
- Psw.2-ov: Overflow bit flag, cleared by hardware when executing arithmetic
- Psw.1: Reserved bit, unused
- Psw.0-p: Parity flag bits, each cycle instruction is cleared by the hardware, indicating an odd even number of bits in accumulator A with a value of 1, odd-time p=1 otherwise 0
Control Parts
The neural center of single-chip microcomputer is based on the main frequency. MCS-51 single-Chip 12mhz,12 machine cycle (oscillation cycle), MSC-51 instruction cycle generally only one or two machine cycles, only multiplication accounted for 4, a instruction cycle of 1us (accounted for half), 2us, 4us, the higher the frequency, the faster the instruction execution speed
Single chip microcomputer CPU