当前位置:网站首页>[MCU] 2.3 CPU of AT89S52
[MCU] 2.3 CPU of AT89S52
2022-07-27 17:57:00 【tsunaa】
2.3 AT89S52 Of CPU
- CPU from Arithmetic unit and controller constitute .
2.3.1 Arithmetic unit
- Arithmetic on operands 、 Logic and bit operations . It mainly includes arithmetic and logic operation unit ALU、 accumulator A、 Bit processor 、 Program status word register PSW And two registers .
1. Arithmetical logic unit ALU
- But for 8 Bit variable logic operation ( And 、 or 、 Exclusive or 、 loop 、 Make up and clear ), Still can Arithmetic operations ( Add 、 reduce 、 ride 、 except )
- ALU also Bit operation function , Bit processing of bit variables , If you set “1”、 clear “0”、 Make up 、 Test transfer and logic “ And ”、“ or ” etc. .
2. accumulator A
- The most frequently used register , Can be written as Acc.“A” And “Acc” Differences in writing , In the fourth 3 Chapter introduction . Special function register area located in the chip .
- It works as follows :
* (1)ALU One of the input data sources of the unit , again ALU Storage of operation results unit .
* (2) Data transfer Mostly through accumulators A, Equivalent to a data transfer station . To solve the problem “ The bottleneck is blocked ” problem ,AT89S52 Added a part of transmission instructions that can not pass through the accumulator . - A Carry flag of Cy It's special , Because it is also Bit accumulator of bit processor .
3. Program status word register PSW
- PSW(Program Status Word) Located in the on-chip special function register area , Byte address is D0H.
- Contains Information about the running status of the program , among 4 Bit saves the status of the current instruction after execution , For program inquiry and judgment . The format is as shown in the figure 2-5 Shown .

- PSW Functions of each bit in :
- (1)Cy(PSW.7) Carry flag bit
- Can be written as C. In arithmetic and logical operations , if Have carry / Borrow position ,Cy=1; otherwise ,Cy=0. In the bit processor , It's a bit accumulator .
- (2)Ac(PSW.6) Auxiliary carry flag bit
- stay BCD Code operation , Used as a decimal adjustment . When D3 Orientation D4 When a carry or borrow occurs ,Ac=1; otherwise ,Ac=0.
- (3)F0(PSW.5) The user sets the flag bit
- A status flag bit used by the user , Instructions can be used to set it 1 Or Qing 0, Control the flow direction of the program . Users should make full use of .
- (4)RS1、RS0(PSW.4、PSW.3)4 Group work register area selection
- Select on-chip RAM In the district 4 A group in the group working register area is the current working register area, as shown in table 2-2.

- Select on-chip RAM In the district 4 A group in the group working register area is the current working register area, as shown in table 2-2.
- (5)OV(PSW.2) overflow flag
- When executing arithmetic instructions , Used to indicate whether the operation result overflows . If the result is overflow ,OV=1; otherwise ,OV=0.
- (6)PSW.1 position : Keep a
- (7)P(PSW.0) Parity flag bit
- Command execution completed , accumulator A in “1” Whether the number of is odd or even .
- P=1, Express A in “1” The number of Odd number .
- P=0, Express A in “1” The number of even numbers .
- This flag bit is of great significance for serial communication , Commonly used Parity test To test the reliability of data serial transmission .
- Command execution completed , accumulator A in “1” Whether the number of is odd or even .
- (1)Cy(PSW.7) Carry flag bit
2.3.2 controller
- Mission : Identification instruction , And according to the nature of the instructions, control the functional components of the single chip microcomputer , So as to ensure that all parts of the single chip microcomputer can work automatically and harmoniously .
- The controller includes : Program counter 、 Instruction register 、 Instruction decoder 、 Timing and control logic circuit, etc . The function is to control the reading of instructions 、 Decoding and execution , Thus, the timing and logic control of each functional component .
- Program counter PC It's an independent 16 Bit counter , inaccessible . When the MCU is reset ,PC The content of 0000H, From program memory 0000H Unit fetch instruction , Start the program .
- PC working process :CPU When reading instructions ,PC As the address of the fetched instruction , The program memory outputs instruction bytes at this address , meanwhile PC Automatic addition 1.
- PC Content change track in Determine the process . When Sequential execution Automatically add 1; perform Transfer program or Subroutines 、 Interrupt subroutine call when , Automatically change its contents to the destination address to be transferred .
- PC Count width of Determines the address range of the program memory .PC by 16 position , Therefore, we can **64KB(=2^16B)** Addressing .
边栏推荐
- 选择体育场馆的LED显示屏时应该注重哪些方面
- 奇瑞欧萌达也太像长安UNI-T了,但长得像,产品力就像吗?
- Microsoft silently donated $10000 to curl, which was not notified until half a year later
- (2) CBAM integrated two stream project construction - data preparation
- Database hyperphone (4)
- Database hyperphone (II)
- Uncle's nephew and his students
- 运行loam_velodyne实时建图
- General process of background management system permission setting
- [introduction to database system (Wang Shan)] Chapter 11 concurrency control
猜你喜欢

ACL 2022 | prompt based automatic depolarization: effectively reducing bias in the pre training language model

Notes on standardized management of "ancestral warehouse" of meituan meal

机器学习——概念理解之IoU

MySQL view and stored procedure

知物由学 | 从0到1搭建实时反外挂机制,多维度补充手游攻防力

面试好难啊!蚂蚁金服的六轮面试我是强撑过来!差点OUT(面试复盘)

Chery omenda is also too similar to Chang'an uni-t, but does it look like it? Is the product power like it?

Zhengzhou University database course resource description

知物由学 | 再造巴别塔,我们如何进行NLP跨语言知识迁移?

机器学习之评价指标(二)——分类评价指标
随机推荐
anaconda重新卸载
泰山OFFICE技术讲座:WORD奇怪的段落边框
From digitalization to intelligent operation and maintenance: what are the values and challenges?
面试官:什么是脚手架?为什么需要脚手架?常用的脚手架有哪些?
7月第4周易盾业务风控关注 | 最高法对APP强索个人信息进行规制
[single chip microcomputer] 2.1 hardware composition of AT89S52 single chip microcomputer
卷积神经网络——YOLOV2(YOLO9000)论文翻译
奇瑞欧萌达也太像长安UNI-T了,但长得像,产品力就像吗?
Maximum number less than n
公网域名如何解析到内网IP服务器——快解析域名映射外网访问
【单片机】2.3 AT89S52的CPU
Soul 1: why is es more suitable for complex condition search than MySQL?
Establishing SSL connection without server‘s identity verification is not recommended
Likeshop takeout ordering system "100% open source without encryption"
美团到餐“祖传数仓”标准化治理笔记
C语言怎么学?这篇文章给你完整答案
Because the employee set the password to "123456", amd stolen 450gb data?
likeshop外卖点餐系统「100%开源无加密」
Windows与网络基础-15-本地安全策略
Explain the idempotence of distributed system in detail