SlideShare a Scribd company logo
1 of 10
Abstract
Computers speak different languages, like people. Some write
data "left-to-right" and others "right-to-left". If a machine can
read its own data it tends to encounter no problems but when
one computer stores data and a different type tries to read it,
that is when a problem occurs. This document aims to present
how Endianness is willing to be taken into consideration how
Endian specific system inter-operate sharing data without
misinterpretation of the value. Endianness describes the
location of the most significant byte (MSB) and least significant
byte (LSB) of an address in memory and is defined by the CPU
architecture implementation of the system. Unfortunately, not
all computer systems are designed with constant Endian
architecture. The difference in Endian architecture is a
difficulty when software or data is shared between computer
systems. Little and big endian are two ways of storing multibyte
data- type (int, float, etc.). In little endian machines, last byte
of binary representation of the multi byte data- type is stored
first. On the opposite hand, in big endian machines, first byte of
binary representation of the multi byte datatype is stored first.
Suppose we write float value to a file on a little-endian machine
and transfer this file to a big-endian machine. Unless there is
correct transformation, big endian machine will read the file in
reverse order. This paper targets on showcasing how CPU-based
Endianness raises software issues when reading and writing the
data from memory. We will try to reinterpret this information at
register/system-level.
Keywords: -
endianness, big-endian, little-endian, most significant byte
(MSB), least significant byte (LSB).
Definition of Endianness
: -
Endianness refers to order of bits or bytes within a binary
representation of a number. All computers do not store multi-
byte value in the same order. The difference in Endian
architecture is an issue when software or data is shared between
computer systems. An analysis of the computer system and its
interfaces will determine the requirements of the Endian
implementation of the software. Based on which value is stored
first, Endianness can be either big or small, with the adjectives
referring to which value is stored first.
Little Endian and Big Endian: -
Endianness illustrates how a 32-bit pattern is held in the four
bytes of memory. There are 32 bits in four bytes and 32 bits in
the pattern, but a choice has to be made about which byte of
memory gets what part of the pattern. There are two ways that
computers commonly do this.
Little endian and Big endian are the two ways of storing
multibyte data types. Little Endian and Big Endian are also
called host byte order and network byte order respectively. In a
multibyte data type, right most byte is called least significant
byte (LSB) and left most byte is called most significant byte
(MSB). In little endian the least significant byte is stored first,
while in big endian, most significant byte is stored. For
example, if we have store 0x01234567, then big and little
endian will be stored as below:
However, within a byte the order of the bits is the same for all
computers, no matter how the bytes themselves are arranged.
Bi -Endian: -
Some architectures such as ARM versions 3 and above, MIPS,
PA-RISC, etc. feature a setting which allows for switchable
endianness in data fetches and stores, instruction fetches, or
both. This feature can improve performance or simplify the
logic of networking devices and software. The word bi-endian,
when said of hardware, denotes the capability of the machine to
compute or pass data in either endian format.
Importance of endianness
:
Endianness is the attribute of a system that indicates whether
the data type like integer values are represented from left to
right or vice-versa. Endianness must be chosen every time
hardware or software is designed.
When Endianness affects code:
Endianness doesn’t apply to everything. If you do bitwise or
bit-shift operations on an int, you don’t notice endianness.
However, when data from one computer is used on another you
need to be concerned. For example, you have a file of integer
data that was written by another computer. To read it correctly,
you need to know:
· The number of bits used to represent each integer.
· The representational scheme used to represent integers (two's
complement or other).
· Which byte ordering (little or big endian) was used.
Processors Endianness
:
CPU controls the endianness. A CPU is instructed at boot time
to order memory as either big or little endian A few CPUs can
switch between big-endian and little-endian. However,
x86/amd64 architectures don't possess this feature. Computer
processors store data in either large (big) or small (little) endian
format depending on the CPU processor architecture. The
Operating System (OS) does not factor into the endianness of
the system, rather the endian model of the CPU architecture
dictates how the operating system is implemented. Big endian
byte ordering is considered the standard or neutral "Network
Byte Order". Big endian byte ordering is in a suitable format for
human interpretation and is also the order most often presented
by hex calculators. As most embedded communication
processors and custom solutions associated with the data plane
are Big-Endian (i.e. PowerPC, SPARC, etc.), the legacy code on
these processors is often written specifically for network byte
order (Big-Endian).
Few of the processors with their respective endianness’s are
listed below: -
Processor
Endianness
Motorola 68000
Big Endian
PowerPC (PPC)
Big Endian
Sun Sparc
Big Endian
IBM S/390
Big Endian
Intel x86 (32 bit)
Little Endian
Intel x86_64 (64 bit)
Little Endian
Dec VAX
Little Endian
Alpha
Bi (Big/Little) Endian
ARM
Bi (Big/Little) Endian
IA-64 (64 bit)
Bi (Big/Little) Endian
MIPS
Bi (Big/Little) Endian
Bi-Endian processors can be run in either mode, but only one
mode can be chosen for operation, there is no bi-endian byte
order. Byte order is either big or little endian.
Performance analysis
:
Endianness refers to data types that are stored differently in
memory, which means there are considerations when accessing
individual byte locations of a multi-byte data element in
memory.
Little-endian processors
have an advantage in cases where the memory bandwidth is
limited, like in some 32-bit ARM processors with 16-bit
memory bus, or the 8088 with 8-bit data bus. The processor can
just load the low half and complete add/sub/multiplication with
it while waiting for the higher half. With big-endian order when
we increase a numeric value, we add digits to the left (a higher
non-exponential number has more digits). Thus, an addition of
two numbers often requires moving all the digits of a big-endian
ordered number in storage, to the right. However, in a number
stored in little-endian fashion, the least significant bytes can
stay where they are, and new digits can be added to the right at
a higher address. Thus, resulting in some simpler and faster
computer operation.
Similarly, when we add or subtract multi-byte numbers, we need
to start with the least significant byte. If we are adding two 16-
bit numbers, there may be a carry from the least significant byte
to the most significant byte, so we must start with the least
significant byte to see if there is a carry. Therefore, we start
with the rightmost digit when doing longhand addition and not
from left. For example, consider an 8-bit system that fetches
bytes sequentially from memory. If it fetches the least
significant byte
first
, it can start doing the addition
while
the most significant byte is being fetched from memory. This
parallelism is why performance is better in little endian on such
as system. In case, it had to wait until both bytes were fetched
from memory, or fetch them in the reverse order, it would take
longer.
In
"Big-Endian" processor
, by having the high-order byte come first, we can quickly
analyze whether a number is positive or negative just by
looking at the byte at offset zero. We don't have to know how
long the number is, nor do you have to skip over any bytes to
find the byte containing the sign information. The numbers are
also stored in the order in which they are printed out, so binary
to decimal routines are highly efficient.
Handling
endianness automatically:-
To work automatically, network stacks and communication
protocols must also define their endianness, otherwise, two
nodes of different endianness won't be able to communicate.
Such a concept is termed as “Network Byte Order”. All protocol
layers in TCP/IP are defined to be big endian which is typically
called network byte order and that they send and receive the
most significant byte first.
If the computers at each end are little-endian, multi-byte
integers passed between them must be converted to network
byte order before transmission, across the network and
converted back to little-endian at the receiving end.
If the stack runs on a little-endian processor, it's to reorder, at
run time, the bytes of each multi-byte data field within the
various headers of the layers. If the stack runs on a big-endian
processor, there’s nothing to stress about. For the stack to be
portable, it's to choose to try and do this reordering, typically at
compile time.
To convert these conversions, sockets provides a collection of
macros to host a network byte order, as shown below:
• htons() - Host to network short, reorder the bytes of a 16-bit
unsigned value from processor order to network order.
• htonl() - Host to network long, reorder the bytes of a 32-bit
unsigned value from processor order to network order.
• ntohs() - Network to host short, reorder the bytes of a 16-bit
unsigned value from network order to processor order.
• ntohl() - Network to host long, reorder the bytes of a 32-bit
unsigned value from network order to processor order.
Let’s understand this with a better example:
Suppose there are two machines S1 and S2, S1 and S2 are big-
endian and little-endian relatively. If S1(BE) wants to send
0x44332211 to S2(LE)
• S1 has the quantity 0x44332211, it'll store in memory as
following sequence 44 33 22 11.
• S1 calls htonl () because the program has been written to be
portable. the quantity continues to be represented as 44 33 22
11 and sent over the network.
• S2 receives 44 33 22 11 and calls the ntohl().
• S2 gets the worth represented by 11 22 33 44 from ntohl(),
which then results to 0x44332211 as wanted.

More Related Content

Similar to AbstractComputers speak different languages, like people. .docx

02 the cpu
02 the cpu02 the cpu
02 the cpuJim Finn
 
Chapter 2Hardware2.1 The System Unit2.2 Data and P
Chapter 2Hardware2.1 The System Unit2.2 Data and PChapter 2Hardware2.1 The System Unit2.2 Data and P
Chapter 2Hardware2.1 The System Unit2.2 Data and PEstelaJeffery653
 
UNIT 2_ESD.pdf
UNIT 2_ESD.pdfUNIT 2_ESD.pdf
UNIT 2_ESD.pdfSaralaT3
 
CST-20363-Session 1-In the Bitginning
CST-20363-Session 1-In the BitginningCST-20363-Session 1-In the Bitginning
CST-20363-Session 1-In the Bitginningoudesign
 
CST 20363 Session 4 Computer Logic Design
CST 20363 Session 4 Computer Logic DesignCST 20363 Session 4 Computer Logic Design
CST 20363 Session 4 Computer Logic Designoudesign
 
Ppt fnr arbitrary length small domain block cipher proposal
Ppt fnr  arbitrary length small domain block cipher proposalPpt fnr  arbitrary length small domain block cipher proposal
Ppt fnr arbitrary length small domain block cipher proposalKarunakar Saroj
 
Microprocessor application (Introduction)
Microprocessor application (Introduction)Microprocessor application (Introduction)
Microprocessor application (Introduction)Ismail Mukiibi
 
Computer fundamental
Computer fundamentalComputer fundamental
Computer fundamentalrachit jaish
 
IMPLEMENTATION OF SOC CORE FOR IOT ENGINE
IMPLEMENTATION OF SOC CORE FOR IOT ENGINEIMPLEMENTATION OF SOC CORE FOR IOT ENGINE
IMPLEMENTATION OF SOC CORE FOR IOT ENGINEijistjournal
 
Multilevel arch & str org.& mips, 8086, memory
Multilevel arch & str org.& mips, 8086, memoryMultilevel arch & str org.& mips, 8086, memory
Multilevel arch & str org.& mips, 8086, memoryMahesh Kumar Attri
 
Joemary.doc
Joemary.docJoemary.doc
Joemary.doccas123
 

Similar to AbstractComputers speak different languages, like people. .docx (20)

Microprocessors and memory concepts
Microprocessors and memory conceptsMicroprocessors and memory concepts
Microprocessors and memory concepts
 
02 the cpu
02 the cpu02 the cpu
02 the cpu
 
Chapter 2Hardware2.1 The System Unit2.2 Data and P
Chapter 2Hardware2.1 The System Unit2.2 Data and PChapter 2Hardware2.1 The System Unit2.2 Data and P
Chapter 2Hardware2.1 The System Unit2.2 Data and P
 
UNIT 2_ESD.pdf
UNIT 2_ESD.pdfUNIT 2_ESD.pdf
UNIT 2_ESD.pdf
 
CST-20363-Session 1-In the Bitginning
CST-20363-Session 1-In the BitginningCST-20363-Session 1-In the Bitginning
CST-20363-Session 1-In the Bitginning
 
Computer components
Computer componentsComputer components
Computer components
 
Module 1 unit 3
Module 1  unit 3Module 1  unit 3
Module 1 unit 3
 
nasm_final
nasm_finalnasm_final
nasm_final
 
CST 20363 Session 4 Computer Logic Design
CST 20363 Session 4 Computer Logic DesignCST 20363 Session 4 Computer Logic Design
CST 20363 Session 4 Computer Logic Design
 
Ppt fnr arbitrary length small domain block cipher proposal
Ppt fnr  arbitrary length small domain block cipher proposalPpt fnr  arbitrary length small domain block cipher proposal
Ppt fnr arbitrary length small domain block cipher proposal
 
Microprocessor application (Introduction)
Microprocessor application (Introduction)Microprocessor application (Introduction)
Microprocessor application (Introduction)
 
Computer fundamental
Computer fundamentalComputer fundamental
Computer fundamental
 
Processing Data
Processing DataProcessing Data
Processing Data
 
מצגת פרויקט
מצגת פרויקטמצגת פרויקט
מצגת פרויקט
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
IMPLEMENTATION OF SOC CORE FOR IOT ENGINE
IMPLEMENTATION OF SOC CORE FOR IOT ENGINEIMPLEMENTATION OF SOC CORE FOR IOT ENGINE
IMPLEMENTATION OF SOC CORE FOR IOT ENGINE
 
Multilevel arch & str org.& mips, 8086, memory
Multilevel arch & str org.& mips, 8086, memoryMultilevel arch & str org.& mips, 8086, memory
Multilevel arch & str org.& mips, 8086, memory
 
Operating system
Operating systemOperating system
Operating system
 
Final report
Final reportFinal report
Final report
 
Joemary.doc
Joemary.docJoemary.doc
Joemary.doc
 

More from makdul

According to Davenport (2014) social media and health care are c.docx
According to Davenport (2014) social media and health care are c.docxAccording to Davenport (2014) social media and health care are c.docx
According to Davenport (2014) social media and health care are c.docxmakdul
 
According to (Fatehi, Gordon & Florida, N.D.) theoretical orient.docx
According to (Fatehi, Gordon & Florida, N.D.) theoretical orient.docxAccording to (Fatehi, Gordon & Florida, N.D.) theoretical orient.docx
According to (Fatehi, Gordon & Florida, N.D.) theoretical orient.docxmakdul
 
According to Libertarianism, there is no right to any social service.docx
According to Libertarianism, there is no right to any social service.docxAccording to Libertarianism, there is no right to any social service.docx
According to Libertarianism, there is no right to any social service.docxmakdul
 
According to Kirk (2016), most of your time will be spent working wi.docx
According to Kirk (2016), most of your time will be spent working wi.docxAccording to Kirk (2016), most of your time will be spent working wi.docx
According to Kirk (2016), most of your time will be spent working wi.docxmakdul
 
According to cultural deviance theorists like Cohen, deviant sub.docx
According to cultural deviance theorists like Cohen, deviant sub.docxAccording to cultural deviance theorists like Cohen, deviant sub.docx
According to cultural deviance theorists like Cohen, deviant sub.docxmakdul
 
According to Gray et al, (2017) critical appraisal is the proce.docx
According to Gray et al, (2017) critical appraisal is the proce.docxAccording to Gray et al, (2017) critical appraisal is the proce.docx
According to Gray et al, (2017) critical appraisal is the proce.docxmakdul
 
According to article Insecure Policing Under Racial Capitalism by.docx
According to article Insecure Policing Under Racial Capitalism by.docxAccording to article Insecure Policing Under Racial Capitalism by.docx
According to article Insecure Policing Under Racial Capitalism by.docxmakdul
 
Abstract In this experiment, examining the equivalence poi.docx
Abstract  In this experiment, examining the equivalence poi.docxAbstract  In this experiment, examining the equivalence poi.docx
Abstract In this experiment, examining the equivalence poi.docxmakdul
 
ACC 403- ASSIGNMENT 2 RUBRIC!!!Points 280Assignment 2 Audi.docx
ACC 403- ASSIGNMENT 2 RUBRIC!!!Points 280Assignment 2 Audi.docxACC 403- ASSIGNMENT 2 RUBRIC!!!Points 280Assignment 2 Audi.docx
ACC 403- ASSIGNMENT 2 RUBRIC!!!Points 280Assignment 2 Audi.docxmakdul
 
ACC 601 Managerial Accounting Group Case 3 (160 points) .docx
ACC 601 Managerial Accounting Group Case 3 (160 points) .docxACC 601 Managerial Accounting Group Case 3 (160 points) .docx
ACC 601 Managerial Accounting Group Case 3 (160 points) .docxmakdul
 
Academic Integrity A Letter to My Students[1] Bill T.docx
Academic Integrity A Letter to My Students[1]  Bill T.docxAcademic Integrity A Letter to My Students[1]  Bill T.docx
Academic Integrity A Letter to My Students[1] Bill T.docxmakdul
 
Access the Center for Disease Control and Prevention’s (CDC’s) Nu.docx
Access the Center for Disease Control and Prevention’s (CDC’s) Nu.docxAccess the Center for Disease Control and Prevention’s (CDC’s) Nu.docx
Access the Center for Disease Control and Prevention’s (CDC’s) Nu.docxmakdul
 
According to DSM 5 This patient had very many symptoms that sugg.docx
According to DSM 5 This patient had very many symptoms that sugg.docxAccording to DSM 5 This patient had very many symptoms that sugg.docx
According to DSM 5 This patient had very many symptoms that sugg.docxmakdul
 
Acceptable concerts include professional orchestras, soloists, jazz,.docx
Acceptable concerts include professional orchestras, soloists, jazz,.docxAcceptable concerts include professional orchestras, soloists, jazz,.docx
Acceptable concerts include professional orchestras, soloists, jazz,.docxmakdul
 
ACA was passed in 2010, under the presidency of Barack Obama. Pr.docx
ACA was passed in 2010, under the presidency of Barack Obama. Pr.docxACA was passed in 2010, under the presidency of Barack Obama. Pr.docx
ACA was passed in 2010, under the presidency of Barack Obama. Pr.docxmakdul
 
Access the FASB website. Once you login, click the FASB Accounting S.docx
Access the FASB website. Once you login, click the FASB Accounting S.docxAccess the FASB website. Once you login, click the FASB Accounting S.docx
Access the FASB website. Once you login, click the FASB Accounting S.docxmakdul
 
Academic Paper  Overview  This performance task was intended to asse.docx
Academic Paper  Overview  This performance task was intended to asse.docxAcademic Paper  Overview  This performance task was intended to asse.docx
Academic Paper  Overview  This performance task was intended to asse.docxmakdul
 
Academic Research Team Project PaperCOVID-19 Open Research Datas.docx
Academic Research Team Project PaperCOVID-19 Open Research Datas.docxAcademic Research Team Project PaperCOVID-19 Open Research Datas.docx
Academic Research Team Project PaperCOVID-19 Open Research Datas.docxmakdul
 
AbstractVoice over Internet Protocol (VoIP) is an advanced t.docx
AbstractVoice over Internet Protocol (VoIP) is an advanced t.docxAbstractVoice over Internet Protocol (VoIP) is an advanced t.docx
AbstractVoice over Internet Protocol (VoIP) is an advanced t.docxmakdul
 
Abstract                                 Structure of Abstra.docx
Abstract                                 Structure of Abstra.docxAbstract                                 Structure of Abstra.docx
Abstract                                 Structure of Abstra.docxmakdul
 

More from makdul (20)

According to Davenport (2014) social media and health care are c.docx
According to Davenport (2014) social media and health care are c.docxAccording to Davenport (2014) social media and health care are c.docx
According to Davenport (2014) social media and health care are c.docx
 
According to (Fatehi, Gordon & Florida, N.D.) theoretical orient.docx
According to (Fatehi, Gordon & Florida, N.D.) theoretical orient.docxAccording to (Fatehi, Gordon & Florida, N.D.) theoretical orient.docx
According to (Fatehi, Gordon & Florida, N.D.) theoretical orient.docx
 
According to Libertarianism, there is no right to any social service.docx
According to Libertarianism, there is no right to any social service.docxAccording to Libertarianism, there is no right to any social service.docx
According to Libertarianism, there is no right to any social service.docx
 
According to Kirk (2016), most of your time will be spent working wi.docx
According to Kirk (2016), most of your time will be spent working wi.docxAccording to Kirk (2016), most of your time will be spent working wi.docx
According to Kirk (2016), most of your time will be spent working wi.docx
 
According to cultural deviance theorists like Cohen, deviant sub.docx
According to cultural deviance theorists like Cohen, deviant sub.docxAccording to cultural deviance theorists like Cohen, deviant sub.docx
According to cultural deviance theorists like Cohen, deviant sub.docx
 
According to Gray et al, (2017) critical appraisal is the proce.docx
According to Gray et al, (2017) critical appraisal is the proce.docxAccording to Gray et al, (2017) critical appraisal is the proce.docx
According to Gray et al, (2017) critical appraisal is the proce.docx
 
According to article Insecure Policing Under Racial Capitalism by.docx
According to article Insecure Policing Under Racial Capitalism by.docxAccording to article Insecure Policing Under Racial Capitalism by.docx
According to article Insecure Policing Under Racial Capitalism by.docx
 
Abstract In this experiment, examining the equivalence poi.docx
Abstract  In this experiment, examining the equivalence poi.docxAbstract  In this experiment, examining the equivalence poi.docx
Abstract In this experiment, examining the equivalence poi.docx
 
ACC 403- ASSIGNMENT 2 RUBRIC!!!Points 280Assignment 2 Audi.docx
ACC 403- ASSIGNMENT 2 RUBRIC!!!Points 280Assignment 2 Audi.docxACC 403- ASSIGNMENT 2 RUBRIC!!!Points 280Assignment 2 Audi.docx
ACC 403- ASSIGNMENT 2 RUBRIC!!!Points 280Assignment 2 Audi.docx
 
ACC 601 Managerial Accounting Group Case 3 (160 points) .docx
ACC 601 Managerial Accounting Group Case 3 (160 points) .docxACC 601 Managerial Accounting Group Case 3 (160 points) .docx
ACC 601 Managerial Accounting Group Case 3 (160 points) .docx
 
Academic Integrity A Letter to My Students[1] Bill T.docx
Academic Integrity A Letter to My Students[1]  Bill T.docxAcademic Integrity A Letter to My Students[1]  Bill T.docx
Academic Integrity A Letter to My Students[1] Bill T.docx
 
Access the Center for Disease Control and Prevention’s (CDC’s) Nu.docx
Access the Center for Disease Control and Prevention’s (CDC’s) Nu.docxAccess the Center for Disease Control and Prevention’s (CDC’s) Nu.docx
Access the Center for Disease Control and Prevention’s (CDC’s) Nu.docx
 
According to DSM 5 This patient had very many symptoms that sugg.docx
According to DSM 5 This patient had very many symptoms that sugg.docxAccording to DSM 5 This patient had very many symptoms that sugg.docx
According to DSM 5 This patient had very many symptoms that sugg.docx
 
Acceptable concerts include professional orchestras, soloists, jazz,.docx
Acceptable concerts include professional orchestras, soloists, jazz,.docxAcceptable concerts include professional orchestras, soloists, jazz,.docx
Acceptable concerts include professional orchestras, soloists, jazz,.docx
 
ACA was passed in 2010, under the presidency of Barack Obama. Pr.docx
ACA was passed in 2010, under the presidency of Barack Obama. Pr.docxACA was passed in 2010, under the presidency of Barack Obama. Pr.docx
ACA was passed in 2010, under the presidency of Barack Obama. Pr.docx
 
Access the FASB website. Once you login, click the FASB Accounting S.docx
Access the FASB website. Once you login, click the FASB Accounting S.docxAccess the FASB website. Once you login, click the FASB Accounting S.docx
Access the FASB website. Once you login, click the FASB Accounting S.docx
 
Academic Paper  Overview  This performance task was intended to asse.docx
Academic Paper  Overview  This performance task was intended to asse.docxAcademic Paper  Overview  This performance task was intended to asse.docx
Academic Paper  Overview  This performance task was intended to asse.docx
 
Academic Research Team Project PaperCOVID-19 Open Research Datas.docx
Academic Research Team Project PaperCOVID-19 Open Research Datas.docxAcademic Research Team Project PaperCOVID-19 Open Research Datas.docx
Academic Research Team Project PaperCOVID-19 Open Research Datas.docx
 
AbstractVoice over Internet Protocol (VoIP) is an advanced t.docx
AbstractVoice over Internet Protocol (VoIP) is an advanced t.docxAbstractVoice over Internet Protocol (VoIP) is an advanced t.docx
AbstractVoice over Internet Protocol (VoIP) is an advanced t.docx
 
Abstract                                 Structure of Abstra.docx
Abstract                                 Structure of Abstra.docxAbstract                                 Structure of Abstra.docx
Abstract                                 Structure of Abstra.docx
 

Recently uploaded

Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 

Recently uploaded (20)

Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 

AbstractComputers speak different languages, like people. .docx

  • 1. Abstract Computers speak different languages, like people. Some write data "left-to-right" and others "right-to-left". If a machine can read its own data it tends to encounter no problems but when one computer stores data and a different type tries to read it, that is when a problem occurs. This document aims to present how Endianness is willing to be taken into consideration how Endian specific system inter-operate sharing data without misinterpretation of the value. Endianness describes the location of the most significant byte (MSB) and least significant byte (LSB) of an address in memory and is defined by the CPU architecture implementation of the system. Unfortunately, not all computer systems are designed with constant Endian architecture. The difference in Endian architecture is a difficulty when software or data is shared between computer systems. Little and big endian are two ways of storing multibyte data- type (int, float, etc.). In little endian machines, last byte of binary representation of the multi byte data- type is stored first. On the opposite hand, in big endian machines, first byte of binary representation of the multi byte datatype is stored first. Suppose we write float value to a file on a little-endian machine and transfer this file to a big-endian machine. Unless there is correct transformation, big endian machine will read the file in reverse order. This paper targets on showcasing how CPU-based Endianness raises software issues when reading and writing the data from memory. We will try to reinterpret this information at register/system-level. Keywords: - endianness, big-endian, little-endian, most significant byte
  • 2. (MSB), least significant byte (LSB). Definition of Endianness : - Endianness refers to order of bits or bytes within a binary representation of a number. All computers do not store multi- byte value in the same order. The difference in Endian architecture is an issue when software or data is shared between computer systems. An analysis of the computer system and its interfaces will determine the requirements of the Endian implementation of the software. Based on which value is stored first, Endianness can be either big or small, with the adjectives referring to which value is stored first. Little Endian and Big Endian: - Endianness illustrates how a 32-bit pattern is held in the four bytes of memory. There are 32 bits in four bytes and 32 bits in the pattern, but a choice has to be made about which byte of memory gets what part of the pattern. There are two ways that computers commonly do this. Little endian and Big endian are the two ways of storing multibyte data types. Little Endian and Big Endian are also called host byte order and network byte order respectively. In a multibyte data type, right most byte is called least significant byte (LSB) and left most byte is called most significant byte (MSB). In little endian the least significant byte is stored first, while in big endian, most significant byte is stored. For example, if we have store 0x01234567, then big and little endian will be stored as below: However, within a byte the order of the bits is the same for all computers, no matter how the bytes themselves are arranged.
  • 3. Bi -Endian: - Some architectures such as ARM versions 3 and above, MIPS, PA-RISC, etc. feature a setting which allows for switchable endianness in data fetches and stores, instruction fetches, or both. This feature can improve performance or simplify the logic of networking devices and software. The word bi-endian, when said of hardware, denotes the capability of the machine to compute or pass data in either endian format. Importance of endianness : Endianness is the attribute of a system that indicates whether the data type like integer values are represented from left to right or vice-versa. Endianness must be chosen every time hardware or software is designed. When Endianness affects code: Endianness doesn’t apply to everything. If you do bitwise or bit-shift operations on an int, you don’t notice endianness. However, when data from one computer is used on another you need to be concerned. For example, you have a file of integer data that was written by another computer. To read it correctly, you need to know: · The number of bits used to represent each integer. · The representational scheme used to represent integers (two's complement or other). · Which byte ordering (little or big endian) was used. Processors Endianness :
  • 4. CPU controls the endianness. A CPU is instructed at boot time to order memory as either big or little endian A few CPUs can switch between big-endian and little-endian. However, x86/amd64 architectures don't possess this feature. Computer processors store data in either large (big) or small (little) endian format depending on the CPU processor architecture. The Operating System (OS) does not factor into the endianness of the system, rather the endian model of the CPU architecture dictates how the operating system is implemented. Big endian byte ordering is considered the standard or neutral "Network Byte Order". Big endian byte ordering is in a suitable format for human interpretation and is also the order most often presented by hex calculators. As most embedded communication processors and custom solutions associated with the data plane are Big-Endian (i.e. PowerPC, SPARC, etc.), the legacy code on these processors is often written specifically for network byte order (Big-Endian). Few of the processors with their respective endianness’s are listed below: - Processor Endianness Motorola 68000 Big Endian
  • 5. PowerPC (PPC) Big Endian Sun Sparc Big Endian IBM S/390 Big Endian Intel x86 (32 bit) Little Endian Intel x86_64 (64 bit) Little Endian
  • 6. Dec VAX Little Endian Alpha Bi (Big/Little) Endian ARM Bi (Big/Little) Endian IA-64 (64 bit) Bi (Big/Little) Endian MIPS Bi (Big/Little) Endian Bi-Endian processors can be run in either mode, but only one mode can be chosen for operation, there is no bi-endian byte
  • 7. order. Byte order is either big or little endian. Performance analysis : Endianness refers to data types that are stored differently in memory, which means there are considerations when accessing individual byte locations of a multi-byte data element in memory. Little-endian processors have an advantage in cases where the memory bandwidth is limited, like in some 32-bit ARM processors with 16-bit memory bus, or the 8088 with 8-bit data bus. The processor can just load the low half and complete add/sub/multiplication with it while waiting for the higher half. With big-endian order when we increase a numeric value, we add digits to the left (a higher non-exponential number has more digits). Thus, an addition of two numbers often requires moving all the digits of a big-endian ordered number in storage, to the right. However, in a number stored in little-endian fashion, the least significant bytes can stay where they are, and new digits can be added to the right at a higher address. Thus, resulting in some simpler and faster computer operation. Similarly, when we add or subtract multi-byte numbers, we need to start with the least significant byte. If we are adding two 16- bit numbers, there may be a carry from the least significant byte to the most significant byte, so we must start with the least significant byte to see if there is a carry. Therefore, we start with the rightmost digit when doing longhand addition and not from left. For example, consider an 8-bit system that fetches bytes sequentially from memory. If it fetches the least significant byte first , it can start doing the addition
  • 8. while the most significant byte is being fetched from memory. This parallelism is why performance is better in little endian on such as system. In case, it had to wait until both bytes were fetched from memory, or fetch them in the reverse order, it would take longer. In "Big-Endian" processor , by having the high-order byte come first, we can quickly analyze whether a number is positive or negative just by looking at the byte at offset zero. We don't have to know how long the number is, nor do you have to skip over any bytes to find the byte containing the sign information. The numbers are also stored in the order in which they are printed out, so binary to decimal routines are highly efficient. Handling endianness automatically:- To work automatically, network stacks and communication protocols must also define their endianness, otherwise, two nodes of different endianness won't be able to communicate. Such a concept is termed as “Network Byte Order”. All protocol layers in TCP/IP are defined to be big endian which is typically called network byte order and that they send and receive the most significant byte first. If the computers at each end are little-endian, multi-byte integers passed between them must be converted to network byte order before transmission, across the network and converted back to little-endian at the receiving end. If the stack runs on a little-endian processor, it's to reorder, at run time, the bytes of each multi-byte data field within the
  • 9. various headers of the layers. If the stack runs on a big-endian processor, there’s nothing to stress about. For the stack to be portable, it's to choose to try and do this reordering, typically at compile time. To convert these conversions, sockets provides a collection of macros to host a network byte order, as shown below: • htons() - Host to network short, reorder the bytes of a 16-bit unsigned value from processor order to network order. • htonl() - Host to network long, reorder the bytes of a 32-bit unsigned value from processor order to network order. • ntohs() - Network to host short, reorder the bytes of a 16-bit unsigned value from network order to processor order. • ntohl() - Network to host long, reorder the bytes of a 32-bit unsigned value from network order to processor order. Let’s understand this with a better example: Suppose there are two machines S1 and S2, S1 and S2 are big- endian and little-endian relatively. If S1(BE) wants to send 0x44332211 to S2(LE) • S1 has the quantity 0x44332211, it'll store in memory as following sequence 44 33 22 11. • S1 calls htonl () because the program has been written to be portable. the quantity continues to be represented as 44 33 22 11 and sent over the network. • S2 receives 44 33 22 11 and calls the ntohl().
  • 10. • S2 gets the worth represented by 11 22 33 44 from ntohl(), which then results to 0x44332211 as wanted.