当前位置:网站首页>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
边栏推荐
- mysql语句
- Information outline recording tool: omnioutliner 5 Pro Chinese version
- \begin{algorithm} 笔记
- 武汉大学甘菲课题组和南昌大学徐振江课题组联合招聘启事
- (五)输出和输出
- C # final review programming question (guessed by the teacher)
- The C programming language (version 2) notes / 8 UNIX system interface / 8.2 low level i/o (read and write)
- Project training of Shandong University rendering engine system (IV)
- JS using RSA encryption and decryption
- The C programming language (version 2) notes / 8 UNIX system interface / 8.1 file descriptor
猜你喜欢

Leetcode 2194. Excel 表中某个范围内的单元格(可以,已解决)

叶子分享站PHP源码下载

How to base on CCS_ V11 new tms320f28035 project

Structural requirement analysis of software engineering student information management system

2080虚拟机登录命令

并发包和AQS

Google浏览器调试技巧
![[MySQL] Cartesian product - multi table query (detailed explanation)](/img/46/6a9a62b35eaa538232da1d738b3931.jpg)
[MySQL] Cartesian product - multi table query (detailed explanation)

MySQL面试整理

idea如何设置导包不带*号
随机推荐
Three paradigms of database
Canvas image processing (Part 1)
goland变成中文版了怎么修改回英文版
(三)Golang - 数据类型
(四)Golang运算符
The C programming language (version 2) notes / 8 UNIX system interface / 8.5 instance (implementation of fopen and Getc functions)
Possible problems of long jump in gaussdb
Anyone who watches "Meng Hua Lu" should try this Tiktok effect
js 使用Rsa 加密 解密
The C programming language (version 2) notes / 8 UNIX system interfaces / 8.6 instances (directory list)
Daily question -890 Find and replace mode
丁总路由器设置以及401联网
STL——函数对象
STL -- function object
CVPR 2022 | meta learning performance in image regression task
JS using RSA encryption and decryption
VIM from dislike to dependence (16) -- macro
博士申請 | 新加坡國立大學Xinchao Wang老師招收圖神經網絡方向博士/博後
The safety of link 01 was questioned, and "ultra high strength" became "high strength"_ Publicity_ Steel_ problem
Cloud development kunkun chicken music box wechat applet source code