当前位置:网站首页>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
边栏推荐
- 丁总路由器设置以及401联网
- Pat class a 1142 largest regiment
- 有哪些特容易考上的院校?
- Token and idempotency
- 从50亿图文中提取中文跨模态新基准Zero,奇虎360全新预训练框架超越多项SOTA
- Google浏览器调试技巧
- Leetcode 2194. Cellules dans une plage dans un tableau Excel (OK, résolu)
- Three paradigms of database
- Large scale real-time quantile calculation -- a brief history of quantitative sketches
- Golang recursively encrypts and decrypts all files under the specified folder
猜你喜欢

Unit sshd.service could not be found

双写一致性问题

收藏 | 22个短视频学习Adobe Illustrator论文图形编辑和排版

使用ubantu时,遇见的一些小毛病和解决方法

IDEA在控制台显示出services,统一管理所有的jetty服务,
![[MySQL] internal connection, external connection and self connection (detailed explanation)](/img/3f/9b88c2f27455f2ddd73808fbb44f8e.jpg)
[MySQL] internal connection, external connection and self connection (detailed explanation)

redis. clients. jedis. exceptions. JedisDataException: NOAUTH Authentication required

Google browser debugging skills

The safety of link 01 was questioned, and "ultra high strength" became "high strength"_ Publicity_ Steel_ problem

Large scale real-time quantile calculation -- a brief history of quantitative sketches
随机推荐
Pat class a 1139 first contact
添加静态路由
Leetcode 2194. Cells within a range in Excel table (yes, solved)
The C programming language (version 2) notes / 8 UNIX system interface / 8.3 open, create, close, unlink
idea如何设置导包不带*号
薛定谔的日语学习小程序源码
1723. 完成所有工作的最短时间
【树莓派】:(四)Camera 进阶
Overview of webrtc's audio network Countermeasures
Canvas advanced functions (Part 2)
su直接切换到超级管理员模式,这样很多报错都可以避免了
每天5分钟玩转Kubernetes | 汇总
js 使用Rsa 加密 解密
\begin{algorithm} 笔记
Uniapp壁纸小程序源码/双端微信抖音小程序源码
Pat class a 1142 largest regiment
Google浏览器调试技巧
程序员爆料:4年3次跳槽,薪资翻了3倍!网友:拳头硬了......
Picture online collection and delivery system source code
Object. Keys traverses an object