当前位置:网站首页>Difference between big end mode and small end mode
Difference between big end mode and small end mode
2022-06-12 16:54:00 【icejuhua】
for example The data is 0x01234567 The memory address is 0x101 0x102 0x103 0x104 among 0 Symbol bit
Big end model :
The big end mode means that the high bit of data is stored in the low address in the memory , The low order of the data is stored in the high address of the memory
The small end model :
Small end mode means that the high bit of data is stored in the high address in the memory , The lower order of the data is stored in the lower address of the address , Opposite to small end mode
As shown in the figure below :
Memory address | 0x101 | 0x102 | 0x103 | 0x104 |
Big end model | 01 | 23 | 45 | 67 |
The small end model | 67 | 45 | 23 | 01 |
Application of large and small end mode :
The use of large and small end mode mainly depends on what mode the MCU supports , The correct way to use it is to choose different modes according to different machines
eg: Big end model :KEIL C51
The small end model : A great deal of ARM,DSP Both use the small end mode ( More common )
There are also microcontrollers that can choose to use different modes
Why is there a difference between the big and small end modes
This is because in a computer system , We are in bytes , Each address corresponds to a byte , A byte is 8bit. But in C In language, except 8bit Of char outside , also 16bit Of short type ,32bit Of long type ( It depends on the specific compiler and system environment ), in addition , For digits greater than 8 Bit processor , for example 16 Bits or 32 Bit processor , Because the register width is larger than one byte , Then there must be a problem of arranging multiple bytes . So it leads to big end storage mode and small end storage mode . For example, one 16bit Of short type x, The address in memory is 0x0010,x The value of is 0x1122, that 0x11 For high byte ,0x22 Is low byte . For big end mode , will 0x11 Put it in the low address , namely 0x0010 in ,0x22 Put it in a high address , namely 0x0011 in . The small end model , Just the opposite . That we use a lot X86 The structure is small end mode , and KEIL C51 It's the big end mode . A great deal of ARM,DSP It's all small end mode . There are some ARM The processor can also choose the big end mode or the small end mode by the hardware .
Finally, let's talk about the advantages and disadvantages
In fact, there are no so-called advantages and disadvantages of the large and small end mode
The small end model : There is no error in the data during the cast , Because the data is stored from small to large according to the memory increment
Big end model : Because the highest bit is the sign bit , So it's easier to judge symbols
边栏推荐
- js监听用户是否打开屏幕焦点
- How to base on CCS_ V11 new tms320f28035 project
- redis. clients. jedis. exceptions. JedisDataException: NOAUTH Authentication required
- 1723. 完成所有工作的最短时间
- 【湖南大学】考研初试复试资料分享
- [BSP video tutorial] BSP video tutorial issue 17: single chip microcomputer bootloader topic, startup, jump configuration and various usage of debugging and downloading (2022-06-10)
- Collect | 22 short videos to learn Adobe Illustrator paper graphic editing and typesetting
- Anyone who watches "Meng Hua Lu" should try this Tiktok effect
- Project training of Shandong University rendering engine system (II)
- Programmers broke the news: 3 job hopping in 4 years, and the salary has tripled! Netizen: the fist is hard
猜你喜欢
Unit sshd.service could not be found
Which colleges are particularly easy to enter?
redis. clients. jedis. exceptions. JedisDataException: NOAUTH Authentication required
双写一致性问题
Iscc-2022 part WP
pytorch和torchvision官方文档使用方法
The safety of link 01 was questioned, and "ultra high strength" became "high strength"_ Publicity_ Steel_ problem
Leetcode 2194. Excel 表中某个范围内的单元格(可以,已解决)
QCustomplot笔记(一)之QCustomplot添加数据以及曲线
Anyone who watches "Meng Hua Lu" should try this Tiktok effect
随机推荐
Programmers broke the news: 3 job hopping in 4 years, and the salary has tripled! Netizen: the fist is hard
su直接切换到超级管理员模式,这样很多报错都可以避免了
QCustomplot笔记(一)之QCustomplot添加数据以及曲线
Information outline recording tool: omnioutliner 5 Pro Chinese version
\Begin{algorithm} notes
程序的动态加载和执行
Google浏览器调试技巧
Exception assertion of assertj
收藏 | 22个短视频学习Adobe Illustrator论文图形编辑和排版
How to play the map with key as assertion
JS monitors whether the user opens the screen focus
Uniapp壁纸小程序源码/双端微信抖音小程序源码
What is compound interest financial product?
程序员爆料:4年3次跳槽,薪资翻了3倍!网友:拳头硬了......
Project training of Shandong University rendering engine system (VI)
修改自己电脑连接的路由器的配置网址192.168.1.1
Structural requirement analysis of software engineering student information management system
Double write consistency problem
Recommend 6 open source projects of yyds
Daily question -890 Find and replace mode