The arithmetic unit is based on the ALU, which is a binary arithmetic/logic operation unit, and is supplemented by the temporary register TMP, the accumulator ACC, the register B, the program status flag register PSW, and the Boolean processor. The accumulator ACC is an eight-bit register, which is the most frequently used register in the CPU. When performing arithmetic and logical operations, the accumulator ACC often temporarily stores an operand (such as the addend) before the operation, and saves the result (such as the algebraic sum) after the operation. Register B is mainly used for multiplication and division operations. The flag register PSW is also an eight-bit register, which is used to store some characteristics of the operation result, such as whether there is a carry or borrow. The specific meaning of each bit is as follows. PSW CY AC FO RS1 RS0 OV - P For users, the following four bits are of most concern.
1? Carry flag CY (PSW?7). It indicates whether there is a carry (or borrow) in the operation. If the operation result has a carry (addition) or a borrow (subtraction) in the highest bit, this bit is 1, otherwise it is 0.
2? Auxiliary carry flag AC Also known as the half-carry flag, it reflects whether there is a half-carry in the lower four bits of the two eight-digit operation, that is, whether there is a carry (or borrow) when adding (or subtracting) the lower four bits. If so, AC is in the 1 state, otherwise it is 0.
3? Overflow flag OV. MCS-51 reflects whether the operation result of the signed number overflows. If there is an overflow, this bit is 1, otherwise it is 0.
4? Parity flag P. Reflects the parity of the content of the accumulator ACC. If the operation result in ACC has an even number of 1s (such as 11001100B, which has 4 1s), P is 0, otherwise, P=1.
The other bits of PSW will be introduced later. Since PSW stores the status of program execution, it is also called the program status word? There is also a logic processor (also known as a Boolean processor) in the operator that performs logical operations on a bit basis. Its function will be explained when introducing bit instructions.
Previous article:The main hardware circuit of ultrasonic rangefinder based on single chip microcomputer
Next article:What are the causes of chip deflection?
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Using a fuel gauge chip to achieve fast and intelligent charging of dual-series lithium batteries
- Here is a disassembly picture of ASUS Mars15 VX60GT9750
- TI blog post: Battery test equipment signal chain
- 【RPi PICO】Use PIO to get more Sigma Delta ADC inputs
- Questions about STLINK programmer
- 【GD32E231 DIY】Human infrared detection (EXTI)
- FPGA Three Kingdoms
- Op amp selection: Could you please recommend an op amp chip model that can amplify 10MHz, 50uV sine wave signals?
- (Repost) This is the first time someone has explained 5G so clearly
- General engineering calculation method for PCB line width and current carrying capacity