Skip to content

Commit 5ade196

Browse files
SSwiniarskiDusch4593KTom101
authored
New Entry: General Endianness (#821)
* Create endianness.md * Update endianness.md * Update content/general/concepts/endianness/endianness.md Co-authored-by: Brandon Dusch <brandondusch@gmail.com> * Update content/general/concepts/endianness/endianness.md Co-authored-by: Brandon Dusch <brandondusch@gmail.com> * Update content/general/concepts/endianness/endianness.md Co-authored-by: Brandon Dusch <brandondusch@gmail.com> * Update content/general/concepts/endianness/endianness.md Co-authored-by: KTom101 <kyra.thompson@nyu.edu> Co-authored-by: Brandon Dusch <brandondusch@gmail.com> Co-authored-by: KTom101 <kyra.thompson@nyu.edu>
1 parent 7abfe58 commit 5ade196

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
Title: 'Endianness'
3+
Description: 'Endianness describes the order in which bytes are stored in memory for multi-byte values.'
4+
Subjects:
5+
- 'Computer Science'
6+
- 'Code Foundations'
7+
Tags:
8+
- 'Numbers'
9+
- 'Memory'
10+
CatalogContent:
11+
- 'paths/code-foundations'
12+
- 'paths/computer-science'
13+
---
14+
15+
**Endianness** describes the order in which bytes are stored in memory for multi-byte values. The options are generally described as big-endian or little-endian. A big-endian system stores the most significant byte at the smallest memory address and the least significant byte at the largest. A little-endian system stores the least significant byte at the smallest memory address and the most significant byte at the largest.
16+
17+
## Example
18+
19+
To store the 32-bit integer `0x0A0B0C0D`, it is broken down into four bytes:
20+
21+
- `0x0A`
22+
- `0x0B`
23+
- `0x0C`
24+
- `0x0D`
25+
26+
The endianness of the computer system defines in what order these bytes are stored in memory. The following examples show it stored at memory address `0xFFF0` for both big- and little-endian systems:
27+
28+
### Big-endian
29+
30+
| Address | Value |
31+
| -------- | ------ |
32+
| `0xFFF0` | `0x0A` |
33+
| `0xFFF1` | `0x0B` |
34+
| `0xFFF2` | `0x0C` |
35+
| `0xFFF3` | `0x0D` |
36+
37+
### Little-endian
38+
39+
| Address | Value |
40+
| -------- | ------ |
41+
| `0xFFF0` | `0x0D` |
42+
| `0xFFF1` | `0x0C` |
43+
| `0xFFF2` | `0x0B` |
44+
| `0xFFF3` | `0x0A` |

0 commit comments

Comments
 (0)