![]() It is up to us (the programmer) to interpret the data at that location. A pointer is a number that references a memory location. Pointers are a key part of programming, especially the C programming language. With me so far? We have 4 bytes, W X Y and Z, each with a different value. If W were to be interpreted as a number, it would be "18" in decimal (by the way, there's nothing saying we have to interpret it as a number - it could be an ASCII character or something else entirely). So, each byte has a value and is made up of 8 bits.įor example, W is an entire byte, 0x12 in hex or 00010010 in binary. ![]() Byte ExampleĬonsider a sequence of 4 bytes, named W X Y and Z - I avoided naming them A B C D because they are hex digits, which would be confusing. And there is no agreement on how these sequences should be stored. However, a lot of data needs to be stored using multiple bytes, like integers or floating-point numbers. Well, this is fine for single-byte data, like ASCII text. If computers agree on the order of every byte, what's the problem? The concept of a byte is the same on all machines, and the idea of which byte is first, second, third (Byte 0, Byte 1, Byte 2.) is the same on all machines. If we store and read data one byte at a time, it will work on any computer. We can use these basic agreements as a building block to exchange data. Bit 0 is the rightmost and the smallest bit 7 is leftmost and largest. So, the binary sequence 00001001 is the decimal number 9. The "leftmost" bit in a byte is the biggest.A bit has two values (on or off, 1 or 0).This gives us a common starting point which makes our lives a bit easier: Thankfully, most computers agree on a few basic data formats (this was not always the case). (i.e., we have many ways to say "ten": ten, 10, diez, etc.) Like humans, computers have different ways to store the same abstract concept.Data (bits and bytes, or marks on paper) is meaningless it must be interpreted to create an abstract concept, like a number.Each type of computer is internally consistent (it can read back its own data), but there are no guarantees about how another type of computer will interpret the data it created. Why does this problem happen? Well, there's no rule that all computers must use the same language, just like there's no rule all humans need to. ![]() Depending on the assumptions made, the 1's and 0's can mean very different things. Later, they read back the 1's and 0's and try to recreate the abstract concept from the raw data. They store data, not abstract concepts, and do so using a sequence of 1's and 0's. The point is that a single piece of data (|O) can be interpreted in many ways, and the meaning is unclear until someone clarifies the intent of the author.Ĭomputers face the same problem. Or maybe an abbreviation for Input/Output. They could have been the letters "IO", a moon of Jupiter. If we see a line and a circle (like this: |O) we may interpret it to mean "ten".īut we assumed the marks referred to a number. There is no inherent meaning in these marks. Data has no inherent meaning and must be interpreted by whoever is reading it.ĭata is like human writing, which is simply marks on paper. Data is a physical concept, a raw sequence of bits and bytes stored on a computer. these representations all point to the same concept of "ten".Ĭontrast this with data. The idea of "ten" doesn't change, no matter what representation you use: ten, 10, diez (Spanish), ju (Japanese), 1010 (binary), X (Roman numeral). The most important concept is to recognize the difference between a number and the data that represents it.Ī number is an abstract concept, such as a count of something. If the header appears backwards, it means data was stored in the other format and needs to be converted. Always include a header that describes the format of the data.Agree to a common format (i.e., all network traffic follows a single format), or. ![]() A machine can read its own data just fine - problems happen when one computer stores data and a different type tries to read it.Some write data "left-to-right" and others "right-to-left". Problem: Computers speak different languages, like people.Problems with byte order are frustrating, and I want to spare you the grief I experienced. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |