Theory: 2.6 – Data Representation

Slides:



Advertisements
Similar presentations
NUMBER SYSTEM. How to convert hexadecimal numbers to decimal numbers? 230 Working from right to left, MULTIPLY each position with 8 raised to the power.
Advertisements

2.2 General Positional-Number-System Conversion
Binary & Decimal numbers = 3* * *10 + 5*1 = 3* * * *10 0 Decimal system: Ten digits: 0,1,2,3,…,9 Example:
Number Systems. 2 The total number of allowable symbols in a number system is called the radix or base of the system. Decimal Numbers: radix = 10 (symbols:
Floating Point Numbers
Computer Systems 1 Fundamentals of Computing
They are the same as registers since they store binary numbers. Called shifting registers since they shift (left or right) the binary number stored in.
The Binary Number System
Memory Terminology & Data Representation CSCI 1060 Fall 2006.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 3 (Part 3): The Fundamentals: Algorithms, the.
Number Systems Part 2 Numerical Overflow Right and Left Shifts Storage Methods Subtraction Ranges.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To be able to use the bitwise logical operators in programs ❏ To be able to use.
Numbering Systems. CSCE 1062 Outline What is a Numbering System Review of decimal numbering system Binary representation range Hexadecimal numbering system.
DECIMAL BASE Based on power of 10 In the number 2,468 – from right to left -- the 8 represents the ones, the 6 represents the tens, the 4 represents the.
Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system?
1 Pertemuan 2 Network Math. Discussion Topics Binary presentation of data Bits and bytes Base 10 number system Base 2 number system Converting decimal.
Conversion of Number System Conversion Among Bases The possibilities: Hexadecimal DecimalOctal Binary
Number System. Number Systems Important Number systems – Decimal – Binary – Hexadecimal.
CPS120: Introduction to Computer Science Computer Math: Converting to Decimal.
Bits & Bytes A bit is the smallest amount of memory used to store information. A bit is represented by either a “0” or a “1”. “Bit” is a contraction of.
Number Systems Revision of conversations What is a register Addition Complementation.
Hexadecimal. Overview Hexadecimal (hex) ~ base 16 number system Use 0 through 9 and... A = 10 B = 11 C = 12 D = 13 E = 14 F = 15.
Octal to Decimal Hexadecimal DecimalOctal Binary.
Hexadecimal Data Representation. Objectives  Know how the Hexadecimal counting system works  Be able to convert between denary, binary & hexadecimal.
Data Representation Hexadecimal  Although computers work in binary it is sometimes inconvenient for humans to read everything in Binary. For example in.
Computer Programming 12 Mr. Jean February 11 th, 2014.
Presentation on Number System
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
Base 16 (hexadecimal) Uses the decimal digits and the first letters of the alphabet to encode 4 binary bits (16=2 4 ) abcdef or ABCDEF.
First Foray into Programming (the hard way). A reminder from last lesson: A machine code instruction has two parts:  Op-code  Operand An instruction.
UMBC CMSC 104 – Section 01, Fall UMBC CMSC 104, Section 01 - Fall 2016  Nothing. Enjoy your weekend! 2.
Programmable Logic Controller
Lecturer: Santokh Singh
Unit 2.6 Data Representation Lesson 1 ‒ Numbers
Images Data Representation.
Number Systems and Codes
Negative numbers: Week 10 Lesson 1
Numeric Data Representation
Octal to Decimal Decimal Octal Binary Hexadecimal.
What is a byte? What is it? How would you use it?
Data Representation Integers
Base ‘b’ number for i = 0 to n – 1 for an n digit quantity
CSE 102 Introduction to Computer Engineering
2.0 COMPUTER SYSTEM 2.2 Number System and Representation
Paging Examples Assume a page size of 1K and a 15-bit logical address space. How many pages are in the system?
Binary Code  
Number Systems Base 2, 10, 16.
Chapter 14 Bitwise Operators Objectives
Hexadecimal Conversions
Binary Lesson 3 Hexadecimal
Binary Lesson 3 Hexadecimal
Digital Logic Design (CSNB163)
Lesson 2: Binary to Denary Conversion.
Binary Lesson 3 Hexadecimal
Number Systems.
Computer Organization
Binary Lesson 3 Hexadecimal
Binary Lesson 4 Hexadecimal and Binary Practice
Lesson 3: Denary to Binary Conversion.
Chapter 2 Number Systems.
Chapter 2 Number Systems.
Binary Lesson 4 Hexadecimal and Binary Practice
Hexadecimal.
Chapter 2 Number Systems.
Number Systems.
WJEC GCSE Computer Science
GCSE COMPUTER SCIENCE Topic 3 - Data 3.3 Logical and Arithmetic Shifts.
Chapter 2 Number Systems.
1. Number Systems Chapt. 2.
Presentation transcript:

Theory: 2.6 – Data Representation Binary Shift

Binary Shift A binary shift (also known as a logical shift) is just as the name suggests; the shifting or moving of binary values to the left or the right. As we know, 8 bits are called a byte, which is the smallest addressable unit of memory. So, a binary shift is moving each bit in a defined direction (left or right). Since we work in bytes, any bits that fall out of that 8 bit block are lost forever. Multiply or divide by Shifts 2 = 21 1 4 = 22 2 8 = 23 3 16 = 24 4 32 = 25 5 64 = 26 6 128 = 27 7

Left Shift Example Example: 3 x 8 128 64 32 16 8 4 2 1 To multiply by 8, we need to shift the binary digits to the left by 3 places. 2 x 2 x 2 = 8 128 64 32 16 8 4 2 1 16 +8 =24

Practise Questions Write these out in binary: 1. 1111 x 4 = Convert to binary first: 3. 70 x 8 = Multiply or divide by Shifts 2 = 21 1 4 = 22 2 8 = 23 3 16 = 24 4 32 = 25 5 64 = 26 6 128 = 27 7

Practise Questions Convert to binary first: 3. 70 x 8 = 01000110 x 8 = 00110000

Right Shift Example Example: 192 ÷ 16 128 64 32 16 8 4 2 1 To divide by 16, we need to shift the binary digits to the right by 4 places. 2 x 2 x 2 x 2 = 16 128 64 32 16 8 4 2 1 8 +4 =12

Practise Questions Write these out in binary: 1. 11001000 ÷ 8 = Multiply or divide by Shifts 2 = 21 1 4 = 22 2 8 = 23 3 16 = 24 4 32 = 25 5 64 = 26 6 128 = 27 7 Write these out in binary: 1. 11001000 ÷ 8 = 2. 00010110 ÷ 2 = Convert to binary first: 3. 224 ÷ 32 =

Practise Questions Write these out in binary: 1. 11001000 ÷ 8 = 00011001 2. 00010110 ÷ 2 = 00001011 Convert to binary first: 3. 224 ÷ 32 = 11100000 ÷ 32 = 00000111

Plenary- Self Assessment Theory Plenary- Self Assessment Using WWW and EBI rate yourself against todays objectives: To be able to demonstrate an understanding of binary shift calculations. Next theory lesson: Hexadecimal Conversions