1

Storage of integer data in memory

2 months ago from

Preparatory knowledge

Original code, inverse code, complement code

There are three representations of signed numbers in computers, namely, original code, inverse code and complement code

The three representations are different.

Original code: directly translate binary into binary in the form of positive and negative numbers

Inverse code: the sign bit of the original code remains unchanged, and the other bits are reversed

Complement: inverse code + 1

The original code of a positive number is the same as the complement of the inverse code

Large and small end introduction

definition:

Large end (storage) mode: the low bit of data is saved in the high address of memory, and the high bit of data is saved in the low address of memory

Small end (storage) mode: the low order of data is saved in the low address of memory, and the high order of data is saved in the high address of memory

Why should there be large and small ends?

In the computer system, taking bytes as the unit, each address unit corresponds to a byte, and one byte is 8bit. For processors with more than 8 bits, there must be a problem of how to arrange multiple bytes because the register width is greater than one byte. Therefore, it leads to large end storage mode and small end storage mode.