Information Science 1

Similar documents
2 Number Systems. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

CSI 333 Lecture 1 Number Systems

Base Conversion written by Cathy Saxton

Useful Number Systems

NUMBER SYSTEMS. William Stallings

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

Positional Numbering System

CPEN Digital Logic Design Binary Systems

=

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

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

Lecture 11: Number Systems

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

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

Number Conversions Dr. Sarita Agarwal (Acharya Narendra Dev College,University of Delhi)

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

Binary, Hexadecimal, Octal, and BCD Numbers

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

Computer Science 281 Binary and Hexadecimal Review

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

NUMBER SYSTEMS. 1.1 Introduction

CPU Organisation and Operation

3. Convert a number from one number system to another

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

Goals. Unary Numbers. Decimal Numbers. 3,148 is s 100 s 10 s 1 s. Number Bases 1/12/2009. COMP370 Intro to Computer Architecture 1

Chapter 4: Computer Codes

Unsigned Conversions from Decimal or to Decimal and other Number Systems

Section 1.4 Place Value Systems of Numeration in Other Bases

Number Systems and Radix Conversion

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

Binary Numbers. Binary Octal Hexadecimal

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

Systems I: Computer Organization and Architecture

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

Number Representation

Chapter 1: Digital Systems and Binary Numbers

Central Processing Unit (CPU)

Lecture 2. Binary and Hexadecimal Numbers

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Chapter 2. Binary Values and Number Systems

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

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

CPU Organization and Assembly Language

Lecture N -1- PHYS Microcontrollers

CS321. Introduction to Numerical Methods

A Step towards an Easy Interconversion of Various Number Systems

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

Number Systems. Introduction / Number Systems

(Refer Slide Time: 00:01:16 min)

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

Chapter 7 Lab - Decimal, Binary, Octal, Hexadecimal Numbering Systems

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

COMPSCI 210. Binary Fractions. Agenda & Reading

Memory is implemented as an array of electronic switches

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

The programming language C. sws1 1

Binary Adders: Half Adders and Full Adders

Let s put together a Manual Processor

THE BINARY NUMBER SYSTEM

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12

Data Storage. 1s and 0s

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

Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals:

APPENDIX B. Routers route based on the network number. The router that delivers the data packet to the correct destination host uses the host ID.

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1

Solution for Homework 2

Numbering Systems. InThisAppendix...

Administrative Issues

Binary Representation

2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal

Decimal to Binary Conversion

Systems I: Computer Organization and Architecture

MICROPROCESSOR AND MICROCOMPUTER BASICS

Introduction to Computer & Information Systems

Copyright 2012 Pearson Education, Inc. Chapter 1 INTRODUCTION TO COMPUTING AND ENGINEERING PROBLEM SOLVING

Computer Science PLUS I Volume 1 : Concepts Government of Tamilnadu

CHAPTER 4 MARIE: An Introduction to a Simple Computer

LSN 2 Computer Processors

Addition Methods. Methods Jottings Expanded Compact Examples = 15

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

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

Chapter 01: Introduction. Lesson 02 Evolution of Computers Part 2 First generation Computers

CS201: Architecture and Assembly Language

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

PROBLEMS (Cap. 4 - Istruzioni macchina)

Design and Development of Virtual Instrument (VI) Modules for an Introductory Digital Logic Course

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

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur

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

Byte Ordering of Multibyte Data Items

Counting in base 10, 2 and 16

Lecture 8: Binary Multiplication & Division

The Hexadecimal Number System and Memory Addressing

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit

Prerequisite knowledge Students should have a good understanding of how our decimal number system works as well as understand place value.

Chapter Binary, Octal, Decimal, and Hexadecimal Calculations

Traveling Circuits Lesson 1 Binary Baubles

Divide: Paper & Pencil. Computer Architecture ALU Design : Division and Floating Point. Divide algorithm. DIVIDE HARDWARE Version 1

Transcription:

Information Science 1 - Representa*on of Data in Memory- Week 03 College of Information Science and Engineering Ritsumeikan University

Topics covered l Basic terms and concepts of The Structure of a Computer l Positional numbering systems decimal binary octal hexadecimal l Conversion among different bases - to decimal and from decimal - other conversions l Test 2

Recall Week 02 l Digital system l Data, Binary l Memory, RAM l Bit, Byte, Computer Word, Address l CPU l CU, ALU, MAR, MDR, IR, GPR, PC, PSW l Machine Cycle, Fetch, Execute, Automatic Sequence Control l Input, Output l Computer Bus 3

Objectives of this class l To understand the fundamentals of numerical data representation and manipulation in computers l To master the skill of representing decimal numbers in the binary, octal, and hexadecimal systems l To be able to speak aloud a number in any of the four bases l To be able to convert from decimal to the above three numbering systems 4

Recall: Computer as a digital system l l A bit is the most basic (and, hence, the smallest) unit of information in a computer - It is a state of on or off in a digital circuit - Sometimes these states are also called as high or low (voltage) A byte is a group of eight bits - A byte is the smallest (in principle) addressable unit of computer storage - Addressable means that a particular byte can be retrieved according to its location 5

Computer words and nibbles l A word is a contiguous group of bytes l - Words can be any number of bytes or bits (word sizes of 32 or 64 bits are now most common) - In a word-addressable system, a word is the smallest addressable unit of memory storage A group of four bits is called a nibble (or nybble) - A byte, therefore, consists of two nibbles: a high-order nibble, and a low-order nibble 00111100010110001010011000110111101 6

Positional numbering system l A positional numbering system (or positional notation system) is a numeral system in which each digit is related to the next by a constant multiplier called the base or radix of that system The value of each digit position is, therefore, the value of its digit multiplied by a power of the base, where the power is determined by the digit's position counted from the separator (which is usually a dot. or comma, ) The value of a number is then calculated as the sum of the values of all positions 7

Decimal system l Decimal numbers have radix (base) = 10 (in Latin, decima means a tenth part ) l Symbols used: l Position weights: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 10 3 10 2 10 1 10 0. 10-1 10-2 10-3 1000 100 10 1 1/10 1/100 1/1000 For example, the decimal number 36.250: 36.250 = 3*10 + 6*1+ 2*1/10 + 5* 1/100 +0* 1/1000 8

Binary system l Binary numbers have radix = 2 (in Latin, bini means two together ) l Symbols used: 0 and 1 l The radix ( 10) is denoted by a subscript (2 l Position weights: 2 3 2 2 2 1 2 0. 2-1 2-2 2-3 8 4 2 1 1/2 1/4 1/8 For example, the binary equivalent of 36.250: 36.250 = 1*32 + 1*4 + 1/4 = 100100.01 (2 9

10 Octal system l Octal numbers have radix = 8 (in Latin, octo means eight) l Symbols used: 0, 1, 2, 3, 4, 5, 6, and 7 l Convenient when bits are grouped in triplets l Position weights: 8 3 8 2 8 1 8 0. 8-1 8-2 2-3 512 64 8 1 1/8 1/64 1/512 For example, the octal equivalent of 36.250: 36.250 = 4*8 + 4*1 + 2*1/8 = 44.2 (8

11 Hexadecimal system l Hexadecimal numbers have radix = 16 (in Greek, hexa means six) l Symbols used: 0,, 9, A, B, C, D, E, and F l Convenient to represent nibbles l Position weights: 16 3 16 2 16 1 16 0. 16-1 16-2 16-3 4096 256 16 1 1/16 1/256 1/4096 For example, the hexadecimal equivalent of 36.250: 36.250 = 2*16 + 4*1 + 4*1/16 = 24.4 (16

12 Radix r numbers l For any radix r number represented with n +m+1 digits as Number (r = a n... a 1 a 0. a -1... a -m its decimal equivalent is calculated as follows: Number (10 = a n r n +... + a 1 r 1 + a 0 + a -1 r -1 +... + a -m r m n = a r i i = m i

Example: ASCII 13

Example: RGB color codes 14

Radix conversion l We can already perform three conversions (from radix r to decimal): Decimal Octal Hexadecimal Binary l There are nine other possible conversions (from decimal, and between radix 2, 8, 16) 15

16 Converting from decimal to l The algorithm: another radix Left of the separator (the decimal point): repeatedly divide the integer part by the radix and write the remainders (R) from right to left Right of the separator: repeatedly multiply the fractional part by the radix and write the integer portion (I) of the result left to right

17 Example: decimal to binary 22.8125 =? (2 22.8125 = 10110 (2. 11 R 0 5 R 1 2 R 1 1 R 0 0 R 1 22.8125 =.1101 (2 1.625 I 1 1.25 I 1 0.5 I 0 1.0 I 1 0 I 0 22.8125 = 10110.1101 (2

18 More examples 1234 =? (8 1234 =? (16 1234 = 2322 (8 154 R 2 19 R 2 2 R 3 0 R 2 1234 = 4D2 (16 77 R 2 4 R 13 = D 0 R 4

19 The remaining conversions l To convert between octal and hexadecimal to/from binary, memorize and use the conversion table (next slide): Octal: use 3 bits for each digit Hexadecimal: use 4 bits for each digit l To convert between octal and hexadecimal, convert to and then from binary 0110100110.1 (2 =? (8 =? (16 000 110 100 110.100 0001 1010 0110.1000 6 4 6.4 1 A 6.8 0110100110.1 (2 = 646.4 (8 = 1A6.8 (16

Conversion table Decimal Base 10 Binary Base 2 Octal Base 8 Hexadecimal Base 16 0 (10 0000 (2 0 (8 0 (16 1 (10 0001 (2 1 (8 1 (16 2 (10 0010 (2 2 (8 2 (16 3 (10 0011 (2 3 (8 3 (16 4 (10 0100 (2 4 (8 4 (16 5 (10 0101 (2 5 (8 5 (16 6 (10 0110 (2 6 (8 6 (16 7 (10 0111 (2 7 (8 7 (16 8 (10 1000 (2 10 (8 8 (16 9 (10 1001 (2 11 (8 9 (16 10 (10 1010 (2 12 (8 A (16 11 (10 1011 (2 13 (8 B (16 12 (10 1100 (2 14 (8 C (16 13 (10 1101 (2 15 (8 D (16 14 (10 1110 (2 16 (8 E (16 15 (10 1111 (2 17 (8 F (16 20

21 Key points of this lecture l Because binary numbers are the basis for all data representation in digital systems, it is important that you become proficient with the binary system to understand the operation of all computer components as well as the design of computer architectures l The binary system is the most important positional numbering system for computers

22 Key points (continued) l It is, however, difficult to read long strings of bits, and even a modestly-sized decimal number becomes a very long binary number For example, 1359510 = 11010100011011 (2 For compactness and ease of reading, binary values are usually expressed using the octal or hexadecimal system l To convert among the different systems, use the conversion algorithms and, when appropriate, the conversion table

23 l Read these slides again Homework l Read slides for the next lecture and do the self-preparation assignments l Learn the vocabulary l Consult, when necessary, the textbook

24 Next class l Representation of data (2) - Basic digital arithmetic - Other representation systems

25 Test 01 l l l l l Put away all electronic devices. Make sure your name and student ID are written at the top of the page. Begin immediately when you receive the test paper. Test papers will be collected for grading. Do not talk until all papers have been collected at the end of the test.