Computer architecture: Data representation - lecture 3b - Charles Fox - University of Lincoln
Overview
Charles Fox explains how binary patterns can encode natural and signed integers, fractions, floating-point values, text, images, audio, and video, with each interpretation determined by an agreed encoding. He connects representation choices to practical tradeoffs, including two's complement arithmetic, IEEE 754 precision and special values, ASCII and Unicode, and compression formats such as JPEG and MP3.
Key takeaways
- An 8-bit pattern has no inherent meaning: the same bits can represent an unsigned number, a signed integer, a character, or part of an image depending on the chosen encoding.
- Two's complement simplifies CPU design because subtraction can be performed with an adder by adding the negated operand and discarding any carry beyond the fixed width.
- An 8-bit unsigned integer spans 0 to 255, while an 8-bit two's complement integer spans -128 to 127, showing how signed representation trades positive range for negative values.
- Floating-point formats balance exponent range against significand precision: IEEE 754 supports very large and small scales, while 16-bit formats reduce memory use with less precision.
- Unicode extends beyond ASCII through UTF encodings, allowing text data to represent scripts and symbols unavailable in ASCII's 7-bit character set.
- Media compression exploits structure in the data: image codecs encode visual features, audio codecs emphasize frequency content, and video codecs often store frame-to-frame changes.
Chapters
- Natural numbers count whole quantities, and an 8-bit pattern such as 01001010 represents 74 when interpreted as an unsigned binary number.
- The same eight physical on/off light bulbs can encode different data depending on the agreed coding scheme.
- Binary addition follows familiar base-10 rules, with 1 + 1 producing a carry into the next column.
- A six-bit sign-magnitude scheme uses one bit for the sign and five for the value, but it gives zero two encodings: positive zero and negative zero.
- One's complement forms a negative value by inverting the magnitude bits; two's complement then adds one.
- Two's complement lets a CPU perform subtraction by adding the two's complement of the number being subtracted, avoiding separate subtraction circuitry.
- For two's complement subtraction, a carry beyond the fixed bit width is discarded.
- An 8-bit unsigned integer represents 0 through 255, while an 8-bit two's complement integer represents -128 through 127.
- A rational value can be stored as two integers for numerator and denominator, but equivalent fractions such as 1/2 and 2/4 create multiple encodings that may require normalization.
- Floating-point numbers use a significand and exponent to cover very large and very small scales, but finite precision makes most values approximations.
- IEEE 754 includes special encodings for positive and negative infinity and NaN, which can represent undefined results such as 0 divided by 0.
- Repeated floating-point calculations can accumulate rounding error, so long-running systems such as spacecraft software must account for numerical precision.
- Half-precision floating point uses 16 bits, including a 5-bit exponent and 10-bit significand, reducing storage compared with 64-bit values at the cost of accuracy.
- bfloat16 uses a larger exponent and smaller significand than half precision, a tradeoff useful for some machine-learning workloads.
- C uses types such as int, short, long, and double, while Rust provides explicit-width types such as i8 and f32 plus pointer-sized isize and usize.
- Charles Fox describes Turing's computational approach to continuous numbers: a program can produce the nth digit of a number such as pi.
- In this framing, a number is represented by an algorithm that returns its digits on demand, rather than by a finite stored decimal expansion.
- The approach relates numbers to programs, but deciding whether two arbitrary computable numbers are equal is not generally possible.
- Writing systems developed from physical tokens and pictographs into more abstract marks, including symbols shaped for tools such as a straight stick pressed into clay.
- Braille uses six binary dot positions, while Morse code combines dots, dashes, and meaningful gaps between signals.
- ASCII assigns 7-bit codes to letters, digits, punctuation, and control actions such as delete and bell; an 8-bit byte leaves one additional bit.
- Unicode supports characters beyond ASCII through encoding formats including UTF-8, UTF-16, and UTF-32.
- A C struct combines differently typed fields, such as a student's name, ID, and exam score, while an array stores repeated values of one type.
- An 8-by-8 monochrome sprite uses eight bytes, one byte per row; color images can use red, green, blue, and alpha channels.
- JPEG compresses image data using wavelet-like or frequency-based features, while MP3 represents audio through frequency components rather than raw samples alone.
- Video compression can store changes between similar frames, and containers such as MP4 package video, audio, and subtitle streams together.
Transcript excerpt
0:00 Now that we've got this basic idea of base systems and binary base in particular, we can we can build upon that and start representing more complex types of data. Um, beginning with different kinds of numbers. The the numbers we've seen so far are a subset of many other forms of numbers and that the subset we've seen are called the natural numbers. Um, say >> often it is said that God created the natural numbers and the rest are the work of man. That the natural numbers are the ones you can actually count physical stuff. If you've got five sheep, you count them in 1 2 3 4 5. That is a natural number. All right? So, it's not a portion of a sheep. It's not a negative sheep. It's not a virtual sheet
0:49 that's been rotated by 90 degrees and sent in a different direction. And it's not a matrix of sheep or anything like that. It's just five god-given sheep. Um, so the natural number system is the easiest one for us to see the link directly into binary. For example, if I've got a set of eight light bulbs, this is my 8 bit representation system and this is a physical device now, right? Remember right at the start we talked about having your repres representation and then encoding it into another actual physical system. So these are these are meant to be eight physical light bulbs actually being turned on and off. Now if I turn the light bulbs on and off in this way and if I tell you that this is a natural number that's the
1:38 important bit. You need you need to know what what code scheme we've all agreed to use. If I tell you this is a natural
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Charles Fox.