Data Representation in Computer Systems: Numbers, Text, and Logical Values

Explore how computers represent various data types—numbers, text, and logical values. This guide explains different number representation schemes (integer, floating-point), character encoding methods (ASCII, Unicode), and the use of bits and bytes for efficient data storage and manipulation in computer systems.



Data Representation in Computer Organization

Data Types in Computer Systems

Computers represent various types of data: numbers, text, and logical values. Each data type has its own way of encoding and manipulating the information.

Representing Numbers

Computers primarily use the binary number system (base-2) to represent numbers. This system uses only two digits: 0 and 1. Different methods exist for representing numbers (integers, floating-point numbers, etc.), each with its own advantages and limitations.

1. Integers (Fixed-Point)

Integers are whole numbers (..., -3, -2, -1, 0, 1, 2, 3, ...). Computers store integers using a fixed number of bits. This fixed number of bits can represent a limited range of values and can be either signed (representing both positive and negative numbers) or unsigned (representing only non-negative numbers).

(The description of the three parameters that describe a fixed-point binary number—signedness, radix point position, and number of fractional bits—is given in the original text and should be included here.)

2. Floating-Point Numbers

Floating-point numbers are used to represent real numbers, including those with fractional parts (e.g., 3.14, -2.5, 0.0). Unlike fixed-point numbers where the position of the decimal point is fixed, the decimal point in floating-point representation can "float", enabling them to represent a wider range of values but often at the cost of precision. The trade-off between range and precision is an important aspect of floating-point representation.

3. Decimal Numbers

Decimal numbers represent values using the base-10 number system. They consist of a whole number part and a fractional part, separated by a decimal point.

Representing Text

Computers represent text using character encoding schemes. Each character (letter, number, symbol) is assigned a unique numerical code, which is stored and manipulated as a binary number. Common encoding schemes include:

1. ASCII (American Standard Code for Information Interchange)

ASCII uses 7 bits to represent 128 characters. It includes uppercase and lowercase letters, numbers, punctuation, and control characters.

Character Decimal Binary Hexadecimal
A 65 1000001 41
Z 90 1011010 5A
a 97 1100001 61
z 122 1111010 7A
0 48 0110000 30
9 57 0111001 39
Space 32 0100000 20
! 33 0100001 21

2. Extended ASCII

Extended ASCII uses 8 bits, allowing for 256 characters.

3. Unicode

Unicode is a more extensive character encoding standard that supports characters from many languages around the world.

Representing Logical Data

Logical data represents true/false values (often 1/0). While a single bit can represent a Boolean value, multiple bits might be used for efficiency. Many programming languages handle Boolean values implicitly.

Bits and Bytes

A bit (b) is the smallest unit of data (0 or 1). A byte (B) is a group of 8 bits. Larger units (KB, MB, GB, TB) are defined as powers of 1024 (not 1000) bytes.

Data Compression

Data compression reduces file size and transmission time. There are two main types:

  • Lossless: No data is lost; original data can be fully recovered. (e.g., ZIP, gzip)
  • Lossy: Some data is lost to achieve greater compression. (e.g., JPEG, MP3)

Conclusion

Computers represent various data types using binary encoding schemes. Understanding these schemes and data compression techniques is fundamental to computer science.