1/14
Looks like no tags are added yet.
Data representation
Definition: The process of encoding and interpreting data in a way that allows computers to store, process, and manipulate information.
Mechanism: Uses binary representation, employing only two symbols (typically 0 and 1) to represent all types of data, including numbers, text, images, and more.
Data size
On the image

Binary Representation
Computers represent data using binary digits, or "bits," which can be either 0 or 1.
A single binary digit is known as a "bit," and a group of eight bits is called a "byte."
Numeric Representation
Integers: Whole numbers can be represented directly in binary form.
Floating-Point Numbers: Real numbers are represented using formats like IEEE 754, which includes a sign bit, an exponent, and a mantissa (fractional part).
Fixed-Point Numbers: Decimals can be represented by fixing the number of digits before andafter the decimal point.
Character Representation
Characters are represented using character encoding schemes, such as ASCII (American Standard Code for Information Interchange) and Unicode.
Each character is assigned a unique binary code (e.g., ASCII 'A' is 01000001).
Text Encoding
Text is stored as a sequence of characters, each represented using the corresponding character encoding.
Unicode is a widely used standard that can represent characters from various scripts and languages.
Image and Graphics Representation
Images can be represented using formats like BMP, JPEG, GIF, and PNG.
Pixels in an image are often represented using binary values for color channels (e.g., RGB values).
Audio Representation
Audio data can be represented using various formats, such as WAV, MP3, and AAC.
Sound samples are typically represented as numerical values in a time-domain or frequency-domain format.
Video Representation
Video data is often represented using formats like MPEG, AVI, and MP4.
Videos are a sequence of images (frames), and each frame is represented as a collection of pixels.
Data Structures
Data structures like arrays, lists, and trees allow for the organization and storage of data in a structured manner.
Elements in data structures are typically stored in contiguous or linked memory locations.
Compression
Data compression techniques reduce the amount of storage or transmission space required for data representation.
Lossless compression (e.g., ZIP) preserves all data, while lossy compression (e.g., JPEG) sacrifices some data quality for reduced file size.
Endianess
Computers can be either little-endian or big-endian in terms of how they store multi-byte data types (e.g., integers).
Endianness affects how bytes are ordered in memory.
Data Type Representation
Programming languages define various data types (e.g., integers, floats, characters) and their representations in memory.
Different data types require different amounts of memory.
Boolean Logic
Computers use binary logic to represent Boolean values (true or false), where 0 often represents false, and 1 represents true.
Network Data Representation
Data is serialized for transmission over networks using formats like JSON, XML, or binary protocols.
Data serialization and deserialization are essential for data exchange between computers.