Computer Data Representation Quiz

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the key field used for in a logical record?

  • To define a physical record
  • To store external representations
  • To manage memory areas
  • To hold the identifier key (correct)

An external representation of data is intended for computing machines.

False (B)

What must data be coded as in a computer system to be recognized later?

Data type

Data must be represented as a sequence of _______ and _______ for internal representation.

<p>0's, 1's</p> Signup and view all the answers

Match the following types of data representation with their characteristics:

<p>External representation = Easily understandable by humans Internal representation = Sequence of 0's and 1's Positional notation = Weights assigned based on position Floating point notation = Used for representing decimal numbers</p> Signup and view all the answers

Which of the following is an example of a non-positional notation?

<p>Roman Numerals (A)</p> Signup and view all the answers

Negative numbers were included in Roman numeral representation.

<p>False (B)</p> Signup and view all the answers

What is the purpose of coding data for long-term archival storage?

<p>To preserve data in databases or archives for future use.</p> Signup and view all the answers

What type of memory allows both reading and writing of data?

<p>RAM (B)</p> Signup and view all the answers

Data stored in ROM can be modified after it has been saved.

<p>False (B)</p> Signup and view all the answers

What does 1 MB equal in bytes?

<p>1,048,576 bytes</p> Signup and view all the answers

Mass storage systems are typically __________ than main memory.

<p>larger</p> Signup and view all the answers

Match the following terms with their definitions:

<p>RAM = Volatile memory that can be read and written ROM = Non-volatile memory that can only be read Mass Storage = Data remains when the computer is off File = Unit of data stored on a mass storage system</p> Signup and view all the answers

What is the typical capacity of a CD?

<p>600-700 MB (A)</p> Signup and view all the answers

Magnetic systems are a form of mass storage.

<p>True (A)</p> Signup and view all the answers

What does a file represent in a mass storage system?

<p>A unit of data</p> Signup and view all the answers

What is the largest positive integer that can be represented in an 8-bit two's complement system?

<p>127 (A)</p> Signup and view all the answers

In two's complement representation, there are two distinct values for zero.

<p>False (B)</p> Signup and view all the answers

What is the process to negate a number in two's complement notation?

<p>Invert all bits and add 1.</p> Signup and view all the answers

The binary representation of -6 in four-bit two's complement is ______.

<p>1010</p> Signup and view all the answers

Match the following operations with their appropriate outcomes in two's complement:

<p>Overflow detection = Occurs when the carry into the MSB does not equal the carry out Adding two positive integers = Can result in a negative value if overflow occurs Negating a number = Invert bits and add 1 Largest positive integer in 8 bits = 127</p> Signup and view all the answers

When does an overflow occur in two's complement addition?

<p>When the result exceeds the maximum positive value (D)</p> Signup and view all the answers

In two's complement, adding two binary numbers is different from adding unsigned binary numbers.

<p>False (B)</p> Signup and view all the answers

What is the binary representation of the two's complement for -1 using 8 bits?

<p>11111111</p> Signup and view all the answers

What does a parity bit indicate in a bit pattern?

<p>Whether the number of 1s is odd or even (C)</p> Signup and view all the answers

A pattern with an even number of 1s under odd parity must contain an error.

<p>True (A)</p> Signup and view all the answers

What is the Hamming Distance between the patterns 110001 and 111110?

<p>3</p> Signup and view all the answers

In error-correcting codes, patterns with fewer than n/2 errors can be __________.

<p>corrected</p> Signup and view all the answers

What is the minimum Hamming Distance between any two legal patterns in the code?

<p>3 (C)</p> Signup and view all the answers

The parity bit is added to the pattern based on the total number of bits in the pattern.

<p>False (B)</p> Signup and view all the answers

Explain how Hamming distance can be used to correct errors in a code.

<p>By designing the code with a minimum Hamming distance of n, patterns with fewer than n/2 errors can be replaced with the closest valid code.</p> Signup and view all the answers

Which of the following compression types results in permanent data loss?

<p>Lossy compression (C)</p> Signup and view all the answers

Run-length encoding replaces long sequences of repeated items with a single instance and a count.

<p>True (A)</p> Signup and view all the answers

What is the purpose of data compression?

<p>To reduce the amount of data needed for storage or transfer.</p> Signup and view all the answers

In ______ compression, the decompressed data is exactly the same as the original data.

<p>lossless</p> Signup and view all the answers

Match the following data compression techniques with their descriptions:

<p>Run-length encoding = Replaces repeated patterns with a count Huffman coding = Uses variable lengths based on frequency of items LZW encoding = Dynamic dictionary encoding system Relative encoding = Records differences between consecutive units</p> Signup and view all the answers

A compression ratio of 14:1 indicates that the compressed data is how many times smaller than the original?

<p>1/14th the size (D)</p> Signup and view all the answers

Frequency-dependent encoding results in a fixed length for all data items.

<p>False (B)</p> Signup and view all the answers

What does the term 'two's complement' refer to?

<p>A method of representing signed binary numbers.</p> Signup and view all the answers

What is the range of values represented in 1's Complement using 8 bits?

<p>-127 to +127 (C)</p> Signup and view all the answers

The 2's complement representation of a positive integer is the same as the original binary with the most significant bit set to 1.

<p>False (B)</p> Signup and view all the answers

How is the 1's complement of a negative integer calculated?

<p>Subtract its magnitude from 2^n - 1.</p> Signup and view all the answers

In 1's complement, the two representations of zero are ______ and ______.

<p>00000000, 11111111</p> Signup and view all the answers

Match the following representations with their respective ranges:

<p>1's Complement = -127 to 127 2's Complement = -128 to 127</p> Signup and view all the answers

What is the first step to calculate the 2's complement of -19 from its binary code for +19?

<p>Invert the digits. (D)</p> Signup and view all the answers

The end-around carry is an issue that exists when using 2's complement.

<p>False (B)</p> Signup and view all the answers

What is the 1's complement of binary number 0001 0011?

<p>1110 1100</p> Signup and view all the answers

Flashcards

RAM vs. ROM

Data saved in RAM can be modified because it can be read and written. However, data stored in ROM is read-only.

Main Memory: Physical View

Main memory is organized into banks, each bank containing a number of bytes arranged in an array.

RAM, ROM, and I/O Ports

Main memory contains bytes stored in RAM, ROM, and input/output ports. RAM bytes can be read and written while ROM bytes are read-only.

Main Memory: Logical View

Main memory is logically viewed as a sequence of bytes, each having a unique address.

Signup and view all the flashcards

Measuring Memory Capacity

A kilobyte (KB) is 1024 bytes, a megabyte (MB) is 1,048,576 bytes, and a gigabyte (GB) is 1,073,741,824 bytes.

Signup and view all the flashcards

Mass Storage Systems

Mass storage systems are non-volatile, meaning data persists even when the computer is off. They are much larger than main memory but slower.

Signup and view all the flashcards

Disk Storage System

A disk storage system consists of tracks divided into sectors, each containing the same number of bits (unless zoned-bit recording is used).

Signup and view all the flashcards

CD & DVD Data Storage

CDs and DVDs store data on a continuous spiral track. The rotation speed must vary to achieve uniform data transfer rates.

Signup and view all the flashcards

Files: Unit of Data

A file is the basic unit of data stored on a mass storage system.

Signup and view all the flashcards

Logical Record

A natural grouping of data within a file, organized from the programmer's perspective.

Signup and view all the flashcards

Field

A sub-unit of a logical record, representing a single piece of data.

Signup and view all the flashcards

Key Field

A specific field in a logical record that acts as a unique identifier.

Signup and view all the flashcards

Physical Record

A block of data that conforms to the physical characteristics of the storage device.

Signup and view all the flashcards

Buffer

An area in memory used for temporary data storage.

Signup and view all the flashcards

External Data Representation

Representation of data that is understandable by humans, often used on paper or other media.

Signup and view all the flashcards

Internal Data Representation

Representation of data using a sequence of 0s and 1s, used internally by computers.

Signup and view all the flashcards

Coding

A system of representing data according to a specific set of rules, either internally or externally.

Signup and view all the flashcards

2's Complement

A method to represent negative numbers in binary by inverting all bits and adding 1.

Signup and view all the flashcards

1's Complement

A method to represent negative numbers in binary by inverting all bits.

Signup and view all the flashcards

1's Complement Range

The range of values that can be represented using n bits in 1's complement. It excludes the negative zero representation.

Signup and view all the flashcards

2's Complement Range

The range of values that can be represented using n bits in 2's complement.

Signup and view all the flashcards

Multiple Representation of Zero (1's Complement)

A special case in 1's complement where both 00000000 and 11111111 represent zero.

Signup and view all the flashcards

End-Around Carry

A special case in 1's complement where the carry from the most significant bit is added to the least significant bit.

Signup and view all the flashcards

2's Complement of Negative Number

In 2's complement, finding the negative representation of an integer by flipping all the bits and adding 1.

Signup and view all the flashcards

2's Complement of Positive Number

In 2's complement, finding the negative representation of a positive integer by flipping all the bits and adding 1.

Signup and view all the flashcards

Compression Ratio

Represents the amount of data needed to store a compressed file compared to the original size.

Signup and view all the flashcards

Lossy Compression

Data is permanently lost during compression, but it allows smaller file sizes.

Signup and view all the flashcards

Lossless Compression

The compressed data is identical to the original, so no data is lost. Useful for preserving original information.

Signup and view all the flashcards

Run-length encoding

Replaces repeated patterns in data with a single instance and a counter indicating the repeats.

Signup and view all the flashcards

Relative encoding

Records differences between consecutive data units instead of the whole units.

Signup and view all the flashcards

Frequency-dependent encoding

Uses varying lengths of bit patterns for data according to their frequency of occurrence.

Signup and view all the flashcards

Adaptive Dictionary Encoding

A technique that uses a dictionary to compress data by replacing repeating sequences with references to the dictionary.

Signup and view all the flashcards

Huffman Encoding

A commonly used lossless compression technique that employs variable length coding for efficient compression.

Signup and view all the flashcards

Parity Bit

A method of detecting errors in data transmission by ensuring that each bit pattern has a specific number of '1' bits (odd or even).

Signup and view all the flashcards

Two's Complement Representation of Negative Integers

In two's complement representation, a negative integer is represented by inverting all the bits of its magnitude and then adding 1 to the result.

Signup and view all the flashcards

Parity Bit (Definition)

A bit added to a data pattern to ensure the resulting pattern has either an odd or even number of '1' bits.

Signup and view all the flashcards

Two's Complement Overflow Detection

The process of determining if the result of an addition operation in two's complement representation has exceeded the maximum representable value for the given number of bits.

Signup and view all the flashcards

Largest Positive Integer in Two's Complement

In two's complement representation, the largest positive integer representable in N bits is 2^(N-1) - 1, which has a bit pattern of one 0 followed by N-1 1s.

Signup and view all the flashcards

Error-Correcting Codes

The ability to not only detect errors in data transmission but also to correct them.

Signup and view all the flashcards

Hamming Distance

The number of bits that differ between two data patterns.

Signup and view all the flashcards

Negating a Number in Two's Complement

The process of finding the negative representation of a binary number in two's complement form.

Signup and view all the flashcards

Addition in Two's Complement

The addition of two's complement numbers is performed as if they were unsigned integers, except for overflow detection.

Signup and view all the flashcards

Error-Correcting Codes using Hamming Distance

A coding scheme where each code pattern has a specific minimum Hamming distance from any other pattern. This allows for error correction by identifying the closest valid code pattern.

Signup and view all the flashcards

Zero in Two's Complement

The bit pattern in two's complement representation where all bits are 0 represents the value zero.

Signup and view all the flashcards

Error-Correcting Codes: Single Bit Change

A code where a single bit change will result in an invalid code pattern, making the error obvious.

Signup and view all the flashcards

Sign Bit in Two's Complement

In two's complement, the sign of a number is determined by the most significant bit (MSB). A 0 in the MSB indicates a positive number, while a 1 indicates a negative number.

Signup and view all the flashcards

Hamming Distance Table

A table showing the Hamming Distance between all pairs of legal codes.

Signup and view all the flashcards

Two's Complement Representation

Two's complement is a method for representing signed binary numbers where the leftmost bit (MSB) represents the sign, and the remaining bits represent the magnitude of the number.

Signup and view all the flashcards

Study Notes

Data Storage

  • Data stored in a computer is represented by bit patterns
  • Bits (binary digits) can represent different values, for example numeric values (1 or 0), boolean values (true or false) or voltage (high or low)
  • Data patterns can represent numbers, text characters, images, sound, or anything else
  • Boolean operations manipulate true/false values, often used as logical operations on bits
  • Boolean operations include AND, OR, XOR (exclusive OR), and NOT
  • Gates are electronic circuits that perform Boolean operations on input values, acting as fundamental building blocks of computers
  • Flip-flops are circuit devices, built from gates, that can store one bit of data
  • A byte is typically 8 bits
  • Main memory acts as a central storage unit in a computer system, storing programs and data during operations utilizing semiconductor integrated circuits
  • Each memory unit (cell) is assigned a unique address
  • Main memory is divided into banks and cells, with each cell represented in an organized array
  • Data in RAM is volatile, while data in ROM is non-volatile
  • Mass storage systems are non-volatile and usually much larger than main memory, performing slower read/write operations compared to main memory
  • Mass storage systems include magnetic systems (disks, tapes) and optical systems (CDs, DVDs)
  • Flash technology (flash drives, SD cards) is also a mass storage method
  • A file is the unit of data stored on a mass storage system
  • Logical records are natural groups within a file
  • Key fields hold identifier keys within a logical record
  • Physical records are blocks of data that fit the characteristics of the storage device
  • Buffers are memory areas used for temporarily storing data

Representing Data

  • Data is coded to be read and understood by a system (internally or externally), through coding systems
  • Information is coded for internal computations, presentation purposes (text, graphics, sound), and long-term storage (databases, archives)
  • Coding ensures that data can be recognized later in the system
  • External representation: (for people) is typically a visually understandable format, like handwritten, graphical, etc...
  • Internal representation: (for computing machines) is a sequence of 0s and 1s
  • For numeric data we use positional formats (e.g. decimal, binary, octal, hexadecimal)

Representing Non-numeric Data

  • Computing devices code letters and special symbols independently
  • Common coding schemes for symbols are ASCII and EBCDIC

Representing Strings in ASCII

  • A 'string' is a sequence of bytes (characters) in ASCII
  • Strings typically contain text characters
  • Strings can have any number of characters
  • The end of a string needs to be identified

Representing Numeric Data

  • Internal number representation is always a sequence of 0's and 1's (binary)
  • External representation uses various notations like Roman Numerals and positional notations (decimal, binary, octal, hexadecimal)
  • Internal number representations can cause overflow when a number is too large to be stored

Representing Data Externally

  • Non-positional notations include Roman Numerals, where digit position does not carry weights. The meaning of digits depends on the context.
  • Positional notations depend on the position of the digits in the number. Decimal, binary, octal and hexadecimal are examples of positional notations.

Octal Encoding

  • Octal encoding is a way to represent bits in groups of three

Representing Images

  • Bit map techniques represent images as collections of dots (pixels)
  • Pixel values are either 0 or 1 (binary) for black and white images and range from 0-255 for grayscale images, or colour images using RGB
  • Vector techniques represent images as sets of lines and curves (circles, polygons).

Colour Depth

  • Colour depth of images is determined by the available palette size
  • Image formats like PNG, BMP, PIC, GIF, JPEG and TIFF are common
  • 1-bit images have 2 colours (e.g., black and white)
  • 8-bit images support 256 grey levels
  • 24-bit images support 16 million colours

Representing Numeric Values

  • Binary notation uses bits to represent numbers in base two.
  • Limitations of computer representations of numeric values can include overflow, which happens when a number is too big to be represented within the available bits

Binary Representation

  • Base ten system uses positions to define quantities and the position (e.g. hundred, ten, one), and their respective quantities
  • Base two system uses positions to define quantities and positions (e.g. eight, four, two, one) and their respective quantities

Decoding Binary Representation

  • The procedure to decode a binary number can involve evaluating the contribution of each bit based on its positional weight and converting it to the decimal equivalent

Positive Integer in Binary Notation

  • An algorithm to find a positive integer's binary representation involves repeatedly dividing the value by two and recording the remainder, until a quotient of zero is obtained. The binary representation consists of the remainders from right to left

Binary Addition

  • Binary addition follows rules that include addition of bits and carry forward when the sum of any two bits is greater than 1.

Fractions in Binary

  • Binary fractions can be decoded according to the positional weight of each bit, allowing their representation to be converted to a decimal representation.
  • To encode binary fractions, repeatedly subtract successive negative powers of 2, recording the success (1) or failure (0) of each subtraction from the radix point until the result is 0.

Representing Integers

  • Unsigned integers, represented in base two and occupying 4 bytes, range from 0 to 4294967295
  • Integers occupy 2n bytes in memory (usually 1, 2, or 3)

Signed Integers

  • Signed integers are whole numbers that can be positive or negative, with ranges from -2147483648 to 2147483647
  • These are represented in ways like sign-magnitude notation, one's complement notation, or two's complement notation.

Representing Integers (Internally) 

  • Sign-magnitude, one's complement, and two's complement notations allow to represent both positive and negative values. The choice of representation influences the way negative values are codified

Representing Integers (Internally) Complement Notations

  • One's complement involves subtracting each bit from 1
  • Two's complement involves subtracting each bit from 1 and adding 1 to the result.

Ranges of Values of N bits 

  • 1's complement has a range of values that can be represented in n bits from -2n-1 + 1 to 2n-1 -1. For one byte (n=8), the range is from -127 to +127
  • 2's complements have a range from -2n-1 to 2n-1 -1. For one byte (n=8), the range is from -128 to +127

Two's Complement

  • Two's complement is a notation to represent both positive and negative integer values. There is only one zero in two's complement (00000000)
  • Negating a number in two's complement involves inverting all the bits and adding 1 to the result.
  • Two's complement addition is the same as adding two unsigned numbers but there is a need to detect overflow.

Excess-N Representation

  • Excess-N representation encodes values by adding a constant offset (N) to the intended value.
  • This system is typically used to represent signed numbers in cases where the representation system avoids the additional complexity associated with sign representation.

Data Compression

  • Data compression reduces the amount of data needed for storage and transfer
  • Compression Ratios describe the ratio of the original data size to the compressed size, e.g. 14:1

Lossy vs Lossless Compression

  • Lossy compression discards some data permanently, while the decompressed data differs from the original
  • Lossless compression preserves all data in the original file, such that if the file is decompressed the resulting file is identical to the original

Generic Data Compression Techniques

  • Run-length encoding identifies repeated binary patterns and represents them with a single instance of the pattern and a count
  • Relative encoding records differences between consecutive data units, rather than representing each unit completely

Frequency-Dependent Encoding

  • Huffman coding uses variable-length bit patterns to represent data items, with frequent items having shorter codes, which is commonly used during text compression.

Adaptive Dictionary Encoding

  • Adaptive dictionary encoding (e.g., Lempel-Ziv encoding) constructs a dictionary of previously encountered blocks and encodes subsequent instances using a reference to that block in the dictionary. The dictionary can change during encoding.

Compressing Images

  • GIF uses lossy compression to limit colours to 256 and dictionary encoding
  • JPEG encompasses several compression techniques.

Communication Errors

  • Data bits may be corrupted during transmission or retrieval from storage
  • Errors can occur due to factors such as dirt or damage on a disc surface, circuit malfunctions or static electricity on transmission path.

Parity Bits

  • Parity refers to the oddness or evenness of the number of bits in a pattern. Odd parity requires each pattern to contain an odd number of 1s; even parity requires an even number of 1s.
  • Parity bits are extra bits to ensure odd or even parity in a message sequence, allowing the reader to detect errors in the message. 

Error-Correcting Codes

  • Error-correcting codes are used to detect and correct errors in data transmission
  • Hamming Distance measures the difference between two bit patterns. The greater the Hamming Distance between two different patterns the less likely they are to overlap (allowing for error detection and correction).

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Lect1_DataStorage.ppt PDF

More Like This

Computers Today and Tomorrow Chapter 2
29 questions
Introduction to Computing - Week 2
9 questions
C4 Almacenamiento - T1
25 questions

C4 Almacenamiento - T1

SecureBliss4137 avatar
SecureBliss4137
Computer Memory Basics
8 questions

Computer Memory Basics

InfallibleVenus avatar
InfallibleVenus
Use Quizgecko on...
Browser
Browser