Computer Systems A - Data Representation and Structure
Introduction to Computer Data Representation
- Information is encoded in computers as 0s and 1s (bits).
- Bits (binary digits) are the fundamental units of data.
- Patterns of bits represent text, numbers, images, and sound.
Data Representation
- Bit Pattern Representation:
- A bit can only be 0 or 1.
- 8 bits form a byte (8 bits = 1 byte).
- Different data types have unique binary encoding.
- Boolean Logic:
- Algebra that results in True or False.
- Main operations: AND, OR, NOT.
- Data Buses:
- Buses connect components in a computer and manage data transfer (address, data, control buses).
Types of Data Encoded in Binary
- Integer Representation:
- Decimal (base-10) to binary (base-2) conversion.
- Text Representation:
- Characters encoded using ASCII (7-bits for 128 characters) or Unicode (16-bits for more characters).
- Audio Representation:
- Digital audio uses samples; more bits per sample leads to better quality (8, 16, 24-bit audio).
- Image Representation:
- Images represented as pixels; higher bit usage per pixel allows for more colors.
- Video Representation:
- Videos are sequences of images (frames).
- File Representation:
- Files are collections of bits following specific formats (e.g., JPG, DOC).
- Data Transmission:
- Data is sent in packets over networks.
CPU Functions
- Central Processing Unit (CPU):
- The brain of the computer, executing instructions and calculations.
- Components of CPU:
- Control Unit (CU): Manages CPU operations; fetches and decodes instructions.
- Arithmetic and Logic Unit (ALU): Carries out arithmetic and logical operations.
- Registers: Fast storage areas for data and instructions currently in use.
- Machine Cycle:
- The process of fetch, decode, execute, and store.
Memory Hierarchy
- Organizes memory by speed, capacity, and cost:
- Register -> Cache -> RAM -> Secondary Storage (HDDs, SSDs).
- Cache Memory:
- High-speed memory storing frequently used data for quick access.
Conclusion
- Understanding data representation is key in computer science, as all computing relies on manipulating bits and binary patterns.