Bits and Bytes. Computer Literacy Lecture 4 29/09/2008

Similar documents
Computer Logic (2.2.3)

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

The Hexadecimal Number System and Memory Addressing

Counting in base 10, 2 and 16

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal.

2011, The McGraw-Hill Companies, Inc. Chapter 3

Binary Representation

Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Chapter 4: Computer Codes

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

Memory is implemented as an array of electronic switches

Today s topics. Digital Computers. More on binary. Binary Digits (Bits)

Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8

Section 1.4 Place Value Systems of Numeration in Other Bases

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:

Base Conversion written by Cathy Saxton

The use of binary codes to represent characters

=

Data Storage 3.1. Foundations of Computer Science Cengage Learning

Binary, Hexadecimal, Octal, and BCD Numbers

CHAPTER 2: HARDWARE BASICS: INSIDE THE BOX

Count the Dots Binary Numbers

Systems I: Computer Organization and Architecture

Definition of Computers. INTRODUCTION to COMPUTERS. Historical Development ENIAC

The Answer to the 14 Most Frequently Asked Modbus Questions

Chapter 3: Computer Hardware Components: CPU, Memory, and I/O

winhex Disk Editor, RAM Editor PRESENTED BY: OMAR ZYADAT and LOAI HATTAR

Introduction to the Mathematics of Big Data. Philippe B. Laval

lesson 1 An Overview of the Computer System

Numbering Systems. InThisAppendix...

Cloud storage Megas, Gigas and Teras

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

Data Storage. Chapter 3. Objectives. 3-1 Data Types. Data Inside the Computer. After studying this chapter, students should be able to:

Encoding Text with a Small Alphabet

Chapter 1. Binary, octal and hexadecimal numbers

Introduction to Computer & Information Systems

encoding compression encryption

Useful Number Systems

Chapter 2: Basics on computers and digital information coding. A.A Information Technology and Arts Organizations

LSN 2 Number Systems. ECT 224 Digital Computer Fundamentals. Department of Engineering Technology

Number Representation

The string of digits in the binary number system represents the quantity

Basic Use of the TI-84 Plus

Binary Adders: Half Adders and Full Adders

Everything you wanted to know about using Hexadecimal and Octal Numbers in Visual Basic 6

The programming language C. sws1 1

Chapter 8 Memory Units

Number Systems. Introduction / Number Systems

Digital codes. Resources and methods for learning about these subjects (list a few here, in preparation for your research):

Traveling Circuits Lesson 1 Binary Baubles

Chapter 6. Inside the System Unit. What You Will Learn... Computers Are Your Future. What You Will Learn... Describing Hardware Performance

CSI 333 Lecture 1 Number Systems

EE 261 Introduction to Logic Circuits. Module #2 Number Systems

Lesson Plan. Course Title: Computer Maintenance Session Title: Numbering Systems

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

CSCA0102 IT & Business Applications. Foundation in Business Information Technology School of Engineering & Computing Sciences FTMS College Global

Positional Numbering System

Data Storage. 1s and 0s

Revised: November GCSE Computer Science

Levent EREN A-306 Office Phone: INTRODUCTION TO DIGITAL LOGIC

IP Networking Primer. Presented by: Michael Leary

MSR605. Programmer s Manual. Magnetic Stripe Card Reader/Writer (High & Low Coercivity) Revision B

CS101 Lecture 11: Number Systems and Binary Numbers. Aaron Stevens 14 February 2011

Introduction To Computers: Hardware and Software

The Subnet Training Guide

Digital Design. Assoc. Prof. Dr. Berna Örs Yalçın

MEMORY STORAGE CALCULATIONS. Professor Jonathan Eckstein (adapted from a document due to M. Sklar and C. Iyigun)

Applications for Business Intelligence, Predictive Analytics and Big Data

Chapter 5. Binary, octal and hexadecimal numbers

Licensed to: CengageBrain User

ASCII Code. Numerous codes were invented, including Émile Baudot's code (known as Baudot

NUMBER SYSTEMS. William Stallings

Technical Information. Digital Signals. 1 bit. Part 1 Fundamentals

Numeration systems. Resources and methods for learning about these subjects (list a few here, in preparation for your research):

STUDY GUIDE CHAPTER 1

Chapter 1: Digital Systems and Binary Numbers

1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal:

Algorithms and Methods for Distributed Storage Networks 7 File Systems Christian Schindelhauer

Computer Science 281 Binary and Hexadecimal Review

Chapter 4 System Unit Components. Discovering Computers Your Interactive Guide to the Digital World

Data Storage: Each time you create a variable in memory, a certain amount of memory is allocated for that variable based on its data type (or class).

Level 2 Development Training. Level 2 Development Training. Level 2 Development Training. Technical Overview

Mass Storage Structure

The Unicode Standard Version 8.0 Core Specification

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Logical Operations. Control Unit. Contents. Arithmetic Operations. Objectives. The Central Processing Unit: Arithmetic / Logic Unit.

LOBs were introduced back with DB2 V6, some 13 years ago. (V6 GA 25 June 1999) Prior to the introduction of LOBs, the max row size was 32K and the

HOMEWORK # 2 SOLUTIO

Main Memory & Backing Store. Main memory backing storage devices

Basics of Digital Recording

DNA Data and Program Representation. Alexandre David

CHAPTER 5. Obfuscation is a process of converting original data into unintelligible data. It

Streaming Lossless Data Compression Algorithm (SLDC)

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

Binary Numbers. Binary Octal Hexadecimal

Binary Number System. 16. Binary Numbers. Base 10 digits: Base 2 digits: 0 1

Lecture 11: Number Systems

Block diagram of typical laptop/desktop

Information, Entropy, and Coding

Discovering Computers Living in a Digital World

Transcription:

Bits and Bytes Computer Literacy Lecture 4 29/09/2008

Lecture Overview Lecture Topics How computers encode information How to quantify information and memory How to represent and communicate binary data The aim is to be able to reason quantitatively about computer systems

Computers encode information What is information? Very difficult to define! communication that has value because it informs? just raw data? semantical content?

Syntax versus Semantics Language has two levels: 1. syntax: notation, sign, symbol 2. semantics: meaning, content, interpretation

Relation between the Two The sign denotes or refers to the content Normally the meaning or content itself can t be displayed just using syntax - which is why dictionaries often use pictures The same meaning can be denoted by many different signs: e.g. 2 and II both refer to the same number as the English word two

What is Information? The information carried by a sign is its interpretation or meaning, i.e. the semantics But the semantical level itself is quite ellusive So computers really just encode and manipulate syntax - we give it a meaning and call it information How do they do it?

Modern Computers are Digital Computers are built out of many electric switches Each switch is on or off at any time Advantages Robust to errors Fast Alternative is analogue codes e.g. along phone lines

Analogue vs Digital Analogue values are continuous, and are often represented using gauges and dials: e.g. weight, temperature, time of day, voltage There is always a margin of error or degree of approximation when reading analogue values. When does the scale read exactly 3 pounds, 2 ounces? Because continuous, analogue can be read to an arbitrary level of precision

Analogue vs Digital Digital values are discrete, as in numerical digits. Hence can be represented in simple numerical terms. On a digital watch display the time increases by discrete steps of 1 second - between seconds there is no way of measuring what fraction of a second has passed

Analogue vs Digital There is always a degree of idealisation in reading digital values, since physical magnitudes are actually continuous (above the quantum level!) There is a range of real weight values that will all cause the digital scale to read exactly 3 pounds, 2 ounces.

Analogue vs Digital Many of the early computing devices used analogue representations e.g. differential analyzers for solving differential equations, slide rules (pre-digital pocket calculators) But virtually all contemporary computers are based on manipulating voltages represented in digital terms, i.e. discrete bits

Analogue vs Digital Advantages of digital over analogue: 1. It is fast: much quicker to decide if a switch is on or off than to decide how much it is on or off. 2. Robust to errors: small errors at each switch in the computer are not propagated. If a digital switch is still a little bit on when it should be off, then the signal coming from it will still be treated as off

Bits of information A bit is one unit of information Comes from binary digit ~1948 bigit and binit were considered! Each bit has one of two values e.g. 1 or 0 The bit is represented by the number, it is not the number Could be represented by True or False, Yes or No, George or Saddam, any binary scheme

Bytes Byte short for binary term coined 1956 Mutation from bite to byte ~1956 1 Byte = 8 bits 1 Byte is the minimum unit of memory that can be accessed by standard computers Used to measure memory, size of files capacity of file-space

Byte Size One byte can express 256 different possibilities, because Each bit can have one of two values: for 2 bits there are 2x2 possibilities (00, 01, 10, 11). With 3 bits there are 2x2x2 possibilities (000, 001, 010, 011...100, 101, 110, 111). With 8 bits there are 2x2x2x2x2x2x2x2 = 256 possibilities

Big Bytes 2 10 bytes = 1024 bytes ~1000 bytes 2 10 bytes = 1 kilobyte = 1KB 1 KB is not 1000 bytes

Bigger Bytes 1 Megabyte (MB) = 1,048,576 bytes = 2 20 bytes 10 6 bytes = 1024 KB 1 Gigabyte (GB) = 1,073,741,824 bytes = 2 30 bytes 10 9 bytes 1 Terabyte (TB) = 2 40 bytes 10 12 bytes 1 Petabyte (PB) = 2 50 bytes 10 15 bytes Followed by exabyte, zettabyte and yottabyte!

How big is big? 300 page novel Floppy Disk 3 minute MP3 track Edinburgh telephone directory CD DVD Corporate customer database Video of your life Human brain

How big is big? 300 page novel 1 MB Floppy Disk 1.44 MB 3 minute MP3 track 2 MB Edinburgh telephone directory 20 MB CD 600-700 MB DVD 4 GB Corporate customer database 1 TB Video of your life 1 PB Human brain > 10 PB

Expressing characters Computers process bits of information We process language through characters or notation Conventions define how characters are expressed in bits, i.e. how computers encode syntax E.g. ASCII, Unicode (used by Java), ANSI, ISO Latin

ASCII American Standard Code for Information Interchange A 01000001? 00111111 a 11100001 9 00111001 Represents 128 characters 8th bit in front allows some error detection Codes parity of the byte, whether byte is odd or even If one bit is corrupted, parity will change

Other conventions ASCII (7 bits) - 128 characters ISO Latin 1 (8 bits) - 256 characters Unicode (16 bits) - 65536 characters E.g. In Japanese, 1,945 ideogram characters in standard use Unicode designed to encode any language character But doubles memory demands Requires compatibility of software

Hexadecimal (Hex) Binary is counting in 2s (twos) Normally we count in 10s (tens) Hexadecimal is counting in 16s (sixteens) Bits can be expressed in hexadecimal with no loss of generality Easier for humans to read! Because bytes can be expressed using two digits in hex (one digit for the first 4 bits, one for the next 4 bits) it s a very widely used system for binary coding

Counting in Hex The sixteen digits of Hex are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F When you get to the numeral for ten, if you used 10, it would be interpreted in Hex as one unit of sixteen plus zero ones, which equals 16 in decimal notation. The original choice of using letters for the numbers from ten to fifteen was arbitrary, but this is now the convention

Keep Counting! 10 in Base 16 equals 16 in Base 10. If we keep going in Hex we get: 10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D, 1E,1F Meaning: 1A (Base 16) = 1x16 + 10x1 (Base 10) = 26 1B (Base 16) = 1x16 + 11x1 (Base 10) = 27 AB3 (Base 16) = 10x16 2 + 11x16 1 + 3x1 (Base 10) = 2733 (Base 10)

Coding Codes in Base 16 As we saw before, ASCII uses binary notation to code standard keyboard characters In turn, Hex is used to code binary numbers Thus we can go from keyboard characters to Hex via ASCII coding

Example The ASCII character code for A is 01000001 Hex coding uses one digit for the number denoted in binary by the first four bits and another for the number denoted by the second four bits By breaking it up we first get 0100, which equals four in binary (one unit of two squared), which is just denoted by 4 in Hex The second half is 0001, which is 1 in binary and Hex The ASCII code 01000001 for A is coded as 41 in Hex

Another Example The ASCII code for? is 00111111 Breaking this up we first get 0011, which equals three in binary (two + one), which is denoted by 3 in Hex The second half, 1111, denotes fifteen in binary (8+4+2+1), which is denoted by F in Hex So the ASCII code 00111111 for? is coded as 3F in Hex

Color Codes An example of Hex in practice is the nondithering RGB color codes Dithering colors look different on different web browsers and are a common fault of many websites http://en.wikipedia.org/wiki/dithering Colors defined by their red green blue (RGB) code look the same using any browser

Non-dithering The non-dithering RGB color codes are binary codes expressed in Hex Each code is 3 bytes long, and each byte is expressed using two digits in Hex E.g. the code 0xCC3399 expresses one byte of information about the level of red (0xCC), one byte about the level of green (0x33), and one byte about the level of blue (0x99). http://www.computerhope.com/htmcolor.htm#02

MIME Multipurpose Internet Mail Extensions Uses Base64 to convert binary data into safe ASCII Industry standard that describes how emails must be formatted so the receiver can interpret the email how non-text (pictures, audiofiles, etc) are converted into ASCII

MIME Takes 3 bytes at a time (24 bits), expresses each block of 6 bits in ASCII, result is four bytes of safe ASCII code File size is increased by 33% as each block of 6 bits is expressed by 8 bits, but encoding benefits from ASCII parity checks.

Key Points Computers process bits very quickly Hex allows the user to talk in binary Characters are encoded by the computer as numbers, using e.g. ASCII Non-text requires encoding

Question Can you recognise encoded information?