What Exactly Is Data and How Does It Work?

  • Thread starter Thread starter hkhil
  • Start date Start date
  • Tags Tags
    Data Earth
Click For Summary
Data is fundamentally an abstraction represented by bits, which are the smallest units in computing, existing as either 1s or 0s. These bits can be stored in various physical mediums, such as magnetic fields on hard drives or microscopic pits on DVDs, allowing them to encode information like music, images, or text. The process of data storage and retrieval involves translating these bits into meaningful representations through hardware like CPUs and displays. Understanding data involves recognizing that it can take many forms, but at its core, it is always reducible to binary code. The discussion emphasizes that data is not just a digital concept but also relates to physical states and representations in the real world.
  • #31
Yeah sorry eNathan, bytes are simply a common currency in common use, but by no means the only practically used unit.
 
Computer science news on Phys.org
  • #32
-Job- said:
Booleans take up 1 bit. I can store up to two 16 booleans in two bytes. (16 booleans / 16 bits= 1 bit) If i only want to store a single bit then i might not have the choice because data storage is not partitioned by individual bits. But that's a formality. Many times it's the bits, and not the bytes, that will affect the program flow.

eNathan's point is that most programming languages (C included) actually use an entire byte for each variable of type bool. The reason, of course, is that the processor is generally design to operate on bytes. Programs which use individual bits must include code to pack and unpack those bits, which slows the program down.

Note that some processors, notably microcontrollers, do provide instructions to operate on individual bits, but these are rarely available in microprocessors.

The following piece of C code demonstrates that my compiler (gcc 3.4.4) uses an entire byte to store a bool:

Code:
#include "stdio.h"

int main()
{
        printf("sizeof(bool) = %d", sizeof(bool));
}

Several people, eNathan included, are making rather semantic arguments in this thread. A boolean value certainly contains no more than a single bit of actual information; on the other hand, a boolean value may occupy an entire byte (or more) of memory, simply because the resulting program runs faster.

- Warren
 
  • #33
booleans aside, bit arrays are stored as individual bits. The entries have to be extracted from the byte using logical masks.
 
  • #34
eNathan's point is that most programming languages (C included) actually use an entire byte for each variable of type bool. The reason, of course, is that the processor is generally design to operate on bytes. Programs which use individual bits must include code to pack and unpack those bits, which slows the program down.
That may be true, but his statement is still not correct. The word bit is used many times when referring to data, especially in other area's of Information Technology out-with Programming. Anyway yes this thread is a bit semantical :biggrin:
 
  • #35
I think data is an abstraction. It is meaningless, by itself, but definable within a system. data in a computer, is whatever we define it to be.
 
  • #36
theName() said:
I think data is an abstraction. It is meaningless, by itself, but definable within a system. data in a computer, is whatever we define it to be.
This is quite true.

Sometimes someone will ask me what particular file is that they don't recognize and can't open with any known program. I suggest they open it in Notepad to see what's in it.

They look surprised "You can do that?"

"Of course (though it might appear to be gobbledegook). All bytes are merely 0-255; it is merely a matter of how they are interpreted. Notepad happens to assign them ASCII letters. Another program might assign them colours. Regardless, they're still just 0-255. The file is interpretation-agnostic. It doesn't know how its data will be interpreted by any given program (although the file can make suggestions, such as "my data is only meaningful as ASCII")

Information = data with meaning.
 
Last edited:

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
1
Views
2K
Replies
7
Views
2K
Replies
4
Views
1K
Replies
19
Views
8K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
48
Views
5K