Nat 4/5 Computing Science Lesson 1: Binary

Slides:



Advertisements
Similar presentations
Binary Negative Integers.
Advertisements

Introduction to Computer Systems
1 Floating Point Representation and Arithmetic (see Patterson Chapter 4)
A Simple ALU Binary Logic.
 Which number is in exponential form: -10,, 10  Identify the Base of that number  What is the exponent in that number? - the number being multiplied.
Fixed-point and floating-point numbers CS370 Fall 2003.
Lecture no 6. Two's Complement Given a negative number (N), represented using the Two's Complement representation (N*), the magnitude of the number (P)
Binary Number Systems.
Number Systems Digital Logic By: Safwan Mawlood
Binary Lesson 3 Hexadecimal. Counting to 15 Base Base Base 16 Base Base Base 16 Two Ten (Hex) Two Ten (Hex)
Data Storage and manipulation. Data Storage Computers store and manipulate data in the form of electronic pulses (high and Low voltages). This digitised.
GCSE Computing Theory © gcsecomputing.net 1 GCSE Computing 2.14 Data Representation Binary Arithmetic.
The Logic of Compound Statements
A-Level Computing#BristolMet Session Objectives#9 express numbers in binary, binary-coded decimal (BCD), octal and hexadecimal; describe and use two’s.
Boolean Algebra. Starter Task State 5 basic data types together with one operation that can be performed on each. We have looked at 4 in the past few.
DATA REPRESENTATION Y. Colette Lemard February
©Brooks/Cole, 2003 Chapter 3 Number Representation.
Mathematics with Binary. Question  Below is a binary string  Which is the least significant bit (LSB)?  Which is the most significant bit (MSB)? 0.
Floating Point Numbers.  Floating point numbers are real numbers.  In Java, this just means any numbers that aren’t integers (whole numbers)  For example…
Computer Systems Nat 4/5 Computing Science Lesson 1: Binary.
Computer Systems Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text.
Binary Representation and Computer Arithmetic
Simple Data Type Representation and conversion of numbers
A-Level Computing Data representation. Objectives Know how data can be represented in a computer system Understand the need for various forms of representation.
Binary Real Numbers. Introduction Computers must be able to represent real numbers (numbers w/ fractions) Two different ways:  Fixed-point  Floating-point.
Factional Values What is 0.75 in binary?. How could we represent fractions? In decimal: – As fractions : 1/5.
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
COMPSCI 210 Semester Tutorial 1
Computer Systems Architecture Copyright © Genetic Computer School 2008 CSA 1- 0 Lesson 1 Number System.
The Teacher CP4 Binary and all that… CP4 Revision.
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
Computer Systems Nat 4/5 Computing Science Data Representation Lesson 2: Floating Point Representation.
The Teacher CP4 Binary and all that… CP4 Revision.
©Brooks/Cole, 2003 Chapter 4 Operations on Bits. ©Brooks/Cole, 2003 Apply arithmetic operations on bits when the integer is represented in two’s complement.
Introduction to Number System
07/12/ Data Representation Two’s Complement & Binary Arithmetic.
Addition and Substraction
Extending Binary In today’s lesson we will look at: representing different types of numbers possible errors binary coded decimal (BCD) comparing BCD with.
NUMBER SYSTEMS.
Computer Systems Nat 4/5 Computing Science Lesson 1: Binary.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.7 Instructor: Lin Chen Sept 2013.
09/03/20161 Information Representation Two’s Complement & Binary Arithmetic.
Learning Objectives 3.3.1f - Describe the nature and uses of floating point form 3.3.1h - Convert a real number to floating point form Learn how to normalise.
Software Design and Development Storing Data Computing Science.
Starter Using two’s Complement form convert the following from Denary to Binary using 8 bits. Answer on mini whiteboard Using two’s.
OCR Computing OGAT Data Types. What OCR need you to know… Data Types a) Primitive data types, integer, real/floating point, character,
WHAT IS BINARY? Binary is a number system that only uses two digits: 1 and 0. Any information that processed by a computer it is put into sequence of.
Floating Point Numbers
Nat 4/5 Computing Science Lesson 1: Binary
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
Department of Computer Science Georgia State University
Fundamentals of Computer Science
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
Data Representation Covering… Binary addition / subtraction
Objectives Today: P4 Data Types – Floating Points P4 Variable Quiz P3 Iteration and Selection Practical Are you logged on? Then come around the table Unit.
Backgrounder: Binary Math
Recap Add these numbers together in binary
Starter Using the fingers on only one hand, what is the highest number you can count to? Rules: You must start at 1 You must count sequentially (i.e.
Binary  Name: Class: .
The Binary System.
Storing Integers and Fractions
COMS 161 Introduction to Computing
Data Binary Arithmetic.
Computer Systems Nat 4/5 Computing Science Data Representation
靜夜思 床前明月光, 疑是地上霜。 舉頭望明月, 低頭思故鄉。 ~ 李白 李商隱.
Section 6 Primitive Data Types
Presentation transcript:

Nat 4/5 Computing Science Lesson 1: Binary Computer Systems Nat 4/5 Computing Science Lesson 1: Binary

Lesson Aims By the end of this lesson: You will be able to: Describe what an integer is Represent positive integers in binary using up to 8 Bits State three advantages of the binary number system Represent negative numbers using binary (Nat 5) Represent real numbers using binary (Nat 5)

The Decimal & Binary Systems Nat 4/5 The Decimal & Binary Systems We use the decimal(denary) or base 10 system This means we have 10 digits : 0-9 Computers use the binary or base 2 system There are only two digits: 0 and 1 Each figure is known as a bit Binary digit Because of our ten fingers? Off and On

Nat 4/5 Decimal Numbers Lets look at how a decimal number is made up: 173 Technically this is: Hundreds Tens Units 1 7 3 102 101 100 Hundreds Tens Units 1 7 3

Nat 4/5 Binary Numbers Because Binary is only made up of two digits (0 and 1) instead of 10 (as in Decimal), the column headings will be different. This is represented as: 24 23 22 21 20 16 8 4 2 1

Nat 4/5 Binary Numbers Lets look at how 173 is stored in binary: 1010 1101 128 64 32 16 8 4 2 1 The binary number is calculated by adding together the value of the columns with a 1. = 128 + 32 + 8 + 4 + 1 = 173

How to convert from Binary Nat 4/5 How to convert from Binary Create your table with the values in the top Insert your binary value into the table Add the place values that have a binary 1 in them: 64+32+4+2 = 102 128 64 32 16 8 4 2 1 1

Advantages of the Binary system Nat 4/5 Advantages of the Binary system There are less rules of arithmetic, this makes it easier to program. 0’s and 1’s are easier to represent digitally in computer systems. Any drop in voltage does not affect the data.

Summary Binary only has two values– 0 & 1 Nat 4/5 Summary Binary only has two values– 0 & 1 A single 0 or 1 is known as a bit Binary Digit The place values in binary start on the right at 1 and double every time going to the left. Advantages of Binary: There are less rules of arithmetic. 0’s and 1’s are easier to represent. Any drop in voltage doesn’t effect data.

What about negative numbers? Nat 5 What about negative numbers? Integers include:- -123, -89, 0, 45, 109876, etc Positive and negative integers are represented using two’s complement

Two’s complement Write -7 :- +7 using 8 bits 0000 0111 Nat 5 Two’s complement Write -7 :- +7 using 8 bits 0000 0111 Change 1’s and 0’s 1111 1000 Add 1 + 1 So -7 is 1111 1001

Nat 5 Twos complement tasks Questions 1 and 2 on Worksheet 1a

Real numbers Decimal Fractions:- 1/10 1/100 1/1000 …. As a fraction Nat 5 Real numbers Decimal Fractions:- 1/10 1/100 1/1000 …. As a fraction 0.1 0.01 0.001 …. As a decimal Binary Fractions:- ½ ¼ 1/8 0.5 0.25 0.125 …. as a fraction 0.1 0.01 0.001 …. as a decimal

Real numbers task Question 3 on Worksheet 1a

Floating point representation From Maths we know that:- 20.125 = .20125 x 102 Mantissa x Base Exponent In binary :- 20.125 = 10100.001 = .10100001 x 2 101 5 in decimal is 101 in binary

Floating point representation Nat 5 Floating point representation The computer stores the mantissa & exponent of a real number .10100001 x 2 101 Mantissa = 10100001 Exponent = 101

Nat 5 Floating point task Question 4 Worksheet 1a