Example 1: Denary = 1. Answer: Binary = (1 * 1) = 1. Example 2: Denary = 3. Answer: Binary = (1 * 1) + (2 * 1) = 3

Similar documents
OCR J276 GCSE Computer Science

Elementary Computing CSC 100. M. Cheng, Computer Science

GCSE Computing. Revision Pack TWO. Data Representation Questions. Name: /113. Attempt One % Attempt Two % Attempt Three %

Standard File Formats

Teaching KS3 Computing. Session 3 Theory: More on binary and representing text Practical: Introducing IF

Data Storage. Slides derived from those available on the web site of the book: Computer Science: An Overview, 11 th Edition, by J.

Bits and Bit Patterns

Objectives. Connecting with Computer Science 2

Discussion. Why do we use Base 10?

Unit 2 Digital Information. Chapter 1 Study Guide

Digital Media. Daniel Fuller ITEC 2110

Computer Systems. IGCSE OCR AQA Edexcel Understand the term. embedded system and how an Purpose of embedded system

The type of all data used in a C++ program must be specified

Data Representation. Types of data: Numbers Text Audio Images & Graphics Video

Bits, bytes, binary numbers, and the representation of information

Chapter 1. Data Storage Pearson Addison-Wesley. All rights reserved

1.1 Data representation

CSC 170 Introduction to Computers and Their Applications. Lecture #1 Digital Basics. Data Representation

Computing in the Modern World

Common Technology Words and Definitions

Module 1: Information Representation I -- Number Systems

FA269 - DIGITAL MEDIA AND CULTURE

MEDIA RELATED FILE TYPES

REPRESENTING INFORMATION:

Using sticks to count was a great idea for its time. And using symbols instead of real sticks was much better.

Flying Start AS Computer Science. September 2015

Data Representation From 0s and 1s to images CPSC 101

Lecture #3: Digital Music and Sound

2nd Paragraph should make a point (could be an advantage or disadvantage) and explain the point fully giving an example where necessary.

Worksheet - Storing Data

Year 10 OCR GCSE Computer Science (9-1)

User. Application program. Interfaces. Operating system. Hardware

General Computing Concepts. Coding and Representation. General Computing Concepts. Computing Concepts: Review

CMSC 1513 Lecture 1.2

Different File Types and their Use

Digital Technologies Hangarau Matihiko Level 1

CC411: Introduction To Microprocessors

Lecture 19 Media Formats

Edexcel GCSE in Computer Science Microsoft IT Academy Mapping

CMSC 104 -Lecture 2 John Y. Park, adapted by C Grasso

CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Jianhui Zhang, Ph.D., Associate Prof. College of Computer Science and Technology, Hangzhou Dianzi Univ.

MINI MOCK (MIMO) Computer Science 2210

GCSE Computer Science Component 02

Prentice Hall. Learning Microsoft PowerPoint , (Weixel et al.) Arkansas Multimedia Applications I - Curriculum Content Frameworks

INTRODUCTION TO COMPUTERS

Frequently Asked Questions about Text and Graphics

Colour and Number Representation. From Hex to Binary and Back. Colour and Number Representation. Colour and Number Representation

Digitization of Multimedia Elements

Introduction to Computer Science (I1100) Data Storage

OCR GCSE Computing Learning Grids H/W

Data Representation. Data is more than just numbers! Representations of Text ASCII. Interpreting bits to give them meaning.

Computer Organization and Assembly Language. Lab Session 01

Unit 2 Lesson 1. Bytes and File Sizes. Resources

1.6 Graphics Packages

[301] Bits and Memory. Tyler Caraza-Harter

Understanding file formats

Sustainable File Formats for Electronic Records A Guide for Government Agencies

255, 255, 0 0, 255, 255 XHTML:

Digital Audio Basics

Gerald's Column by Gerald Fitton

Data Representation 1

An Overview of the Computer System. Kafui A. Prebbie 24

2011 Francisco Delgadillo

Topic 2 Data and Information. Data Data can be defined as a set of recorded facts, numbers or events that have no meaning.

AQ A G C S E 9-1 C O M P U T E R S C I E N C E R E V I S I O N G U I D E M U R P H Y V I A A M A Z O N

Computers Are Your Future Prentice-Hall, Inc.

Lecture 1: What is a computer?

The Programming Process Summer 2010 Margaret Reid-Miller

AQA GCSE Computer Science PLC

UNDERSTANDING MUSIC & VIDEO FORMATS

COMP 102: Computers and Computing

OCR J276 GCSE Computer Science

Information Communications Technology (CE-ICT) 6 th Class

NUMBERS AND DATA REPRESENTATION. Introduction to Computer Engineering 2015 Spring by Euiseong Seo

St Ignatius Girls JL - Form 3. Contents

The type of all data used in a C (or C++) program must be specified

Image Types Vector vs. Raster

M4-R4: INTRODUCTION TO MULTIMEDIA (JAN 2019) DURATION: 03 Hrs

Day 3. Storage Devices + Types of Memory + Measuring Memory + Computer Performance

Experimental Methods I

Hardware and Operating Systems.

Analogue vs. Discrete data

Characterisation. Digital Preservation Planning: Principles, Examples and the Future with Planets. July 29 th, 2008

Sahalsoftware college. Welcome To understanding Basic Computer Concept

15/09/15. Introduction to Computers & The Internet. Contents. Computer hardware and software. Input and output devices CPU. Memory.

Fundamental of Digital Media Design. Introduction to Audio

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-278: Digital Logic Design Fall Notes - Unit 4. hundreds.

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700: Digital Logic Design Winter Notes - Unit 4. hundreds.

Unicode. Standard Alphanumeric Formats. Unicode Version 2.1 BCD ASCII EBCDIC

RECOMMENDED FILE FORMATS

Chapter 1: Why Program? Computers and Programming. Why Program?

Logo & Icon. Fit Together Logo (color) Transome Logo (black and white) Quick Reference Print Specifications

SOFTWARE AND MULTIMEDIA. Chapter 6 Created by S. Cox

Final Study Guide Arts & Communications

CPSC 301: Computing in the Life Sciences Lecture Notes 16: Data Representation

Data Representation and Networking

How to make a PDF from inside Acrobat

Intermediate Programming & Design (C++) Notation

Transcription:

1.1.1 Binary systems In mathematics and digital electronics, a binary number is a number expressed in the binary numeral system, or base-2 numeral system, which represents numeric values using two different symbols: typically 0 (zero) and 1 (one). More specifically, the usual base-2 system is a positional notation with a radix of 2. Because of its straightforward implementation in digital electronic circuitry using logic gates, the binary system is used internally by almost all modern computers and computer-based devices such as mobile phones. Each digit is referred to as a bit. Calculating binary numbers Likewise, when working with binary numbers, the position is important in order for you to be able to calculate the correct value. The value 1 in binary represents the value one, the value 0 represents zero. For base-two binary numbers, you need to multiply each digit on the left by a progressive factor of 2. As with denary numbers, the calculations always work from right to left. Example 1: Denary = 1 0 0 0 0 0 0 0 1 Answer: Binary = 00000001 (1 * 1) = 1 Example 2: Denary = 3 0 0 0 0 0 0 1 1 Answer: Binary = 00000011 (1 * 1) + (2 * 1) = 3

Example 3: Denary = 6 0 0 0 0 0 1 1 0 Answer: Binary = 00000110 (1 * 0) + (2 * 1) + ( 4 * 1) = 6 Example 4: Denary = 12 0 0 0 0 1 1 0 0 Answer: Binary = 00001100 (1 * 0) + (2 * 0) + (4 * 1) + (8 * 1) = 12 Example 5: Denary = 37 0 0 1 0 0 1 0 1 Answer: Binary = 00100101 (1 * 1) + (2 * 0) + (4 * 1) + (8 * 0) + (16 * 0) + (32 * 1) = 37 Example 6: Denary = 115 0 1 1 1 0 0 1 1 Answer: Binary = 01110011 (1 * 1) + (2 * 1) + (4 * 0) + (8 * 0) + (16 * 1) + (32 * 1) + (64 * 1) = 115

Example 7: Denary = 255 1 1 1 1 1 1 1 1 Answer: Binary = 11111111 (the maximum 8 digit binary number) (1 * 1) + (2 * 1) + (4 * 1) + (8 * 1) + (16 * 1) + (32 * 1) + (64 * 1) = 255 if the digit is a 0 then just don't add that value to the total. The number below has a 0 in the 32 position and the binary number in decimal is: 1 1 0 1 1 1 1 1 1x128 + 1x64 + 0x32 + 1x16 + 1x8 + 1x4 + 1x2 + 1x1 = 223 decimal Let's try a smaller binar y number: What is 10101 in decimal? Answer: 1 0 1 0 1 1x16 + 0x8 + 1x4 + 0x2 + 1x1 = 21 decimal

Bit A 'bit' (short for Binary Digit) is the smallest unit of data that can be stored by a computer. Each 'bit' is represented as a binary number, either 1 (tr ue) or 0 (false). Byte A 'byte' contains 8 bits, so for example, it could be stored as 11101001. A single keyboard character that you type, such as the letter A or the letter T takes up one byte of storage. Nibble This is not a very commonly used term compared to bit and byte. It is the term given to a group of four bits. Therefore two nibbles make a byte. The reason it is not very common is because most microprocessors use groups of 8 bits and higher i.e. they use one or more bytes to process data. Not many devices make use of a nibble. Kilobyte A kilobyte is a unit of storage capacity. It can be written as kb or kbyte. A kilobyte is generally thought of as 1,000 bytes. However, to be completely correct, it is actually 1,024 bytes which is 2 to the power of 10. This would be equivalent to 1024 characters on the screen.

Images usually take up more storage space than text characters. The images below will help you put storage sizes into context. Storage size = 7 kilobytes Storage size = 33 kilobytes So a simple, limited colour image as seen on the left will take up much less storage than the detailed (but cute) image on the right. Megabyte A megabyte is a unit of storage capacity. It can be written as MB or mbyte. A Megabyte is generally thought of as one million bytes or 1,000 kilobytes. However, to be completely correct, it is actually 1,048,576 bytes or 1,024 kilobytes. PowerPoint presentations on the other hand can be quite large. For example, a ten slide presentation with an image on each slide and a theme applied to the slide backgrounds could be 2 or 3 megabytes in size. A typical MP3 song can be anywhere between 3 to 5 megabytes in size. A CD can store up to 650 megabytes of data.. Gigabyte A Gigabyte is equivalent to 1024 Megabytes although you will commonly see it referred to as 1,000 Megabytes (which isn't correct). It can be written as GB or gbyte, but not Gb (used for gigabit). 1 Gigabyte could hold the contents of about 10 yards of books on a book shelf. A DVD can store a Hollywood blockbuster film which would be around 4-8 gigabytes in size. Hard disks are measured in gigabytes, with a typical hard disk size being around 160 gigabytes or more.

Terabyte Commonly written as TB. A terabyte is equivalent to 1024 Gigabytes although you will commonly see it referred to as 1,000 Gigabytes (which isn't correct). 1.1.2 Hexadecimal numbers This is name given to numbers using the base-16 notation. Allowed Hexadecimal digits are: Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F The decimal numbers 10 to 15 are represented with the letters A to F. There are 16 values, hence why it is a base-16 number system. Hexadecimal is widely used in computing because it is a much shorter way of representing a byte of data. If we were to r epresent a byte of data in binar y, it would require 8 digits, e.g. 11111111. However, that same byte of data could be represented in hexadecimal in just two digits e.g. FF - much more compact and user friendly than a binary number. The table above only shows hexadecimal numbers up to denary 15. The largest byte value is 255 and you can use hexadecimal numbers to repr esent up to this value. We can extend the table above to show the next set of hexadecimal numbers: Decimal 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Hexadecimal 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F Once we have gone past the first 16 numbers, a 1 is added in front of the next 16 numbers (similar to denary when we go from 0-9 and then the next 10 numbers have a 1 in front of them) The next set of hexadecimal numbers would have a 2 in front of them: Decimal 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 Hexadecimal 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F See if you can complete the table for the next set: Decimal 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 Hexadecimal

Hexa to decimal HEX 0 1 2 3 4 5 6 7 8 9 A B C D E F DEC 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Here is a HEX number: 1E5DF To convert this to a DEC, we need to define the base for our power function. Since HEX is based on 16 different digits [0-9A-F], our base is 16. To convert from HEX to DEC, follow these steps: We know that F = 15 in DEC so we use this formula (15*16 0 ) = 15 We know that D = 13 in DEC so we use this formula (13*16 1 ) = 208 We know that 5 = 5 in DEC so we use this formula (5*16 2 ) = 1280 We know that E = 14 in DEC so we use this formula (14*16 3 ) = 57344 We know that 1 = 1 in DEC so we use this formula (1*16 4 ) = 65536 Now we add all of the numbers together to get the DEC number for HEX number 1E5DF: 15 + 208 + 1280 + 57344 + 65536 = 124383 Hexa to binary Example #1 Convert (4E) 1 6 (4) = (0100) 1 6 2 (E) = (1110) 1 6 2 to binary: S o (4E) 16 = (01001110) 2 Example #2 Convert (4A01) (4) = (0100) 1 6 2 (A) = (1010) 16 2 (0) = (0000) 1 6 2 (1) = (0001) 1 6 2 16 to binary: S o (4A01) = (0100101000000001) 16 2

0 Uses of hexadecimal in computing Here are two important aspects to the beauty of using Hexadecimal with computers: First, it can represent 16-bit words in only four Hex digits, or 8- bit bytes in just two; thus, by using a numeration with more symbols, it is both easier to work with (saving paper and screen space) and makes it possible to understand. This is why programs such as DEBUG, use only Hexadecimal to display the actual Binary bytes of a Memory Dump rather than a huge number of ones and zeros! The second aspect is closely related: Whenever it is necessary to convert the Hex representation back into the actual Binary bits, the process is simple enough to be done in your own mind. For example, FAD7 hex is 1111101011010111 (F=1111, A=1010, D=1101, 7=0111) in Binary. A common use of hexadecimal numbers is to describe colors on web pages. Each of the three primary colors (i.e., red, green and blue) is represented by two hexadecimal digits to create 255 possible values, thus resulting in more than 16 million possible colors. For example, the HTML (hypertext markup language) code telling a browser to render the background color of a web page as red is <body bgcolor="#ff0000"> and that telling it to render the page as white is <body bgcolor="#ffffff">. MAC addresses consist of hex values, and a Media Access Control (MAC) address looks like this: Af-14-b3-c2-14-45 The first oddity with MAC addresses is that we've got numbers and letters in the address. Since every single networking device should have a unique MAC address, we have to use hex rather than the usual decimals we're all familiar with. Using hex to express an address allows us to have many more possible combinations than we'd have if we just used decimals.

1.1.2 Data storage Understanding different formats to store sound, pictures, video, text and numbers 1 Plain text (.txt). In this case, the individual characters in the document (letters, punctuation, newlines etc.) are each encoded into bytes using the ASCII encoding, and stored in a simple sequence. This format only stores the text itself, with no information about formatting, fonts, page size, or anything like that. It is portable across all Computer systems and can be read and modified by a huge range of software applications. The details of the format are freely available and standardized. If the storage media are damaged, any undamaged sections can be recovered without problems. 2 Word document (.doc). In this case the text plus formatting, page size and so on is stored in a complex encoding. 3 PDF (Portable Document Format,.pdf). In this case, the text plus formatting, page size and similar information are stored in a moderately complex encoding. While the details of this encoding are freely available, the format is owned by Adobe and can be changed by them at any time, for any reason. The document can be viewed and printed on all major platforms, using free software provided by Adobe (or others). PDF documents cannot be readily edited. 4 HTML (Hypertext Markup Language,.html). The text, plus simple formatting, is stored in a simple encoding.this format is freely available and controlled by a public-interest standards body. The document can be viewed in any web browser. It can be edited in a text editor by someone who knows HTML, or in any number of rich text editors, word processors, HTML editors and so on. 5 An image format such as JPEG (.jpg) or TIFF. While the image can be viewed on any modern platform using a wide range of software, editing the content of the document (the sequence of characters, words etc.) will be extremely cumbersome. This format preserves appearance but loses all structure. However this may be an option for documents that only exist on paper, perhaps with a plan to use optical character recognition (OCR) to migrate to a text-based format in the future. Binary Representation of Bitmap Images All bitmap images are stored as an array of pixels. A monochrome bitmap will store a 1 for a black pixel and 0 for a white pixel (or vice-versa depending on the encoding protocol).

This image could be represented by the following 35 binary digits (5 bytes): 00100 01010 01010 10001 11111 10001 00000 It would also be necessary to store the dimensions of the image. If the image were in colour, using a colour palette of 256 possible shades, each pixel would need to translate to a value between 0 and 256 (8 bits). Thus we would need 35 bytes to store the image. It is common for colours to be recorded by quantity or Red, Green and Blue (RGB) and this is stored using 3 bytes per pixel so we would need 105 bytes to store the image. Bitmap images can be encoded in order to reduce the file size. Examples of encoded bitmaps in clued JPG, PNG and GIF file types. Binary Representation of Sound In order to digital record sound, a microphone is used, a device that converts the analogue sound into a digital form by altering the output signal from the device. In order to store this digitally, the voltage is sampled at frequent intervals (typically 48 000 times per second or 48kHz) and stored as a binary code (typically 16 or 32 bits per sample). This equates to slightly over 1.5 million bits per second, or 88 MB per minute. An 80 minute album stored in such a manner would require 6.9 GB of storage. There are three ways of altering this: Sample Rate : By reducing the sample rate (e.g. to 22 khz), you reduce the amount of data you need to store. This has quite serious effects on the quality of the audio. Contact the teacher: 03215275281

Sample Depth : Much as with colour, you can reduce the precision of each datum, using only 8 bits per sample instead of 32, for example. Compression : Ideally you would sample at the highest practical rate you can and these use an encoding algorithm to reduce the output file size (this is why Audacity projects are much bigger in size than the files output). This can be Lossless compression (e.g. FLAC [and potentially MP3/AAC/Ogg Vorbis files]) or Lossy compression (e.g. most MP3, AAC and Ogg Vorbis files). WAV and AIFF files are used for storing uncompressed audio.