Introduction to computers 103 學年度 上學期 Solution of Homework_ch12 授課教授:李錫智.

Slides:



Advertisements
Similar presentations
COMP2130 Winter 2015 Storing signed numbers in memory.
Advertisements

Sample Test 1 Question. A pattern of binary digits can be interpreted in several different ways. Show how the pattern translates using each of.
Introduction to Computers -1 st exam- 授課教授:李錫智. 1. Given 12 bits, (a).How many different distinct combinations can we get from these bits? Ans: 2 12 =
Binary Representation Introduction to Computer Science and Programming I Chris Schmidt.
Representations Example: Numbers –145 –CVL – –91 –
Representing Information as Bit Patterns
Introduction to Computing Systems (1st Exam). 1. [10] What is the range of decimal integers that can be represented by the following given numbers of.
Quiz 1.1 Convert the following unsigned binary numbers to their decimal equivalent: Number2 Number
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
Computer Science 210 Computer Organization Floating Point Representation.
Review Binary Basic Conversion Binary Decimal
Lecture 8 Floating point format
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Binary Representation and Computer Arithmetic
Convert Decimal to Floating point number [IEEE 754]
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
Simple Data Type Representation and conversion of numbers
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
Computer Architecture
Binary Arithmetic & Data representation
Introduction to Computers 第三次考試 授課教授 : 李錫智. 第一題 [15] Suppose random(x,y) returns an integer randomly between x and y inclusively. Consider the following.
COMPSCI 210 Semester Tutorial 1
Binary, Decimal and Hexadecimal Numbers Svetlin Nakov Telerik Corporation
Data Representation - Part II. Characters A variable may not be a non-numerical type Character is the most common non- numerical type in a programming.
Floating Point Representations CDA 3101 Discussion Session 02.
The Teacher CP4 Binary and all that… CP4 Revision.
Number Representation
The Teacher CP4 Binary and all that… CP4 Revision.
Introduction to computers 103 學年度 上學期 Solution of Homework_ch1 授課教授:李錫智.
Integer & Floating Point Representations CDA 3101 Discussion Session 05.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
THE BINARY NUMBER SYSTEM “There are only 10 types of people in this world: Those who understand BINARY and those who do not.”
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.6 Instructor: Lin Chen Sept 2013.
Computing Machinery Chapter 6: Computer Arithmetic.
Floating Point in Binary 1.Place Value Chart:
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
CEC 220 Digital Circuit Design Binary Codes
Data Representation: Floating Point for Real Numbers Computer Organization and Assembly Language: Module 11.
Lecture 6 Excess Notation. Excess 8 notation indicates that the value for zero is the bit pattern for 8, that is 1000 Excess 8 notation indicates that.
Sample Test 1 Question This one includes ASCII.. Sample Test 1 Question Show how the pattern translates using each of the following interpretations.
Georgia Institute of Technology Introduction to Programming Part 3 Barb Ericson Georgia Institute of Technology May 2006.
1 COMS 161 Introduction to Computing Title: Computing Basics Date: September 8, 2004 Lecture Number: 7.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
CEC 220 Digital Circuit Design Binary Codes Mon, Aug 31 CEC 220 Digital Circuit Design Slide 1 of 14.
Exercise 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
Computer Organization 1 Data Representation Negative Integers.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Software Design and Development Storing Data Computing Science.
COMPUTER ARITHMETIC Binary Coded Decimal Presented By Chung Wai Chow.
FLOATING-POINT NUMBER REPRESENTATION
Fundamentals of Computer Science
Topic: Binary Encoding – Part 2
Recitation3: CS 3843 Computer Organization 4th week
Introduction To Computer Science
Computer Science 210 Computer Organization
Floating Point Number system corresponding to the decimal notation
EPSII 59:006 Spring 2004.
CSE 102 Introduction to Computer Engineering
Computer Science 210 Computer Organization
بسم الله الرحـــــــمن الرحيم
BCD = Binary Coded Decimal
CSE 113 A January 12 – 16, 2009.
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
Chapter 6: Computer Arithmetic
Numbers representations
January 12 – 16, 2009 CSE 113 B.
COMS 161 Introduction to Computing
Presentation transcript:

Introduction to computers 103 學年度 上學期 Solution of Homework_ch12 授課教授:李錫智

Question 1 Please convert these units as shown below.(8 bits) Binary -> Decimal ( ) 2 = ( ) 10 ( ) 2 = ( ) 10 Decimal -> Binary (16) 10 = ( ) 2 (106) 10 = ( ) 2 (255) 10 = ( ) 2

Solution Q * * * *2 5 = * * * * *2 7 = 109

Solution Q / 2 = 8…0=>( ) 2 8 / 2 = 4…0 4 / 2 = 2…0 2 / 2 = 1…0 1 / 2 = 0…1 106 / 2 = 53…0=>( ) 2 53 / 2 = 26…1 26 / 2 = 13…0 13/ 2 = 6…1 6 / 2 = 3…0 3 / 2 = 1…1 1 / 2 = 0…1

Solution Q / 2 = 127…1=>( ) / 2 = 63…1 63 / 2 = 31…1 31 / 2 = 15…1 15 / 2 = 7…1 7 / 2 = 3…1 3 / 2 = 1…1 1 / 2 = 0…1

Question 2 Unsigned integer can be just only represented to positive numbers, if you want to represent to negative number, you can use 2’s complement notation. (8 bits) Please convert these units as shown below in 2’s complement. Binary -> Decimal ( ) 2 = ( ) 10 ( ) 2 = ( ) 10 Decimal -> Binary (-5) 10 = ( ) 2 (-128) 10 = ( ) 2 (127) 10 = ( ) 2

Solution Q =>sign: Positive 1* * * *2 5 = =>sign: Negative ==invert==>> (-1) * ( 1* * * )= -51

Solution Q == sign + invert(5-1) == sign + invert(4) == sign + invert(128-1) == sign + invert(127) =

Question 3 Strings can be represented as sequences of ASCII codes. How would the string “EE107” be represented? What string would be represented by bit pattern “ ”?

Solution Q3-1 ‘E’ = ‘1’ = ‘0’ = ‘7’ = ANS :

Solution Q ANS : Goal

Question 4 What the value would be represented by the bit pattern with IEEE single-precision floating point? (Format is represented by (-1) s * 2 k * 1.yyyy…)

Solution Q = 142 (-1) 0 * * ( ) 2 = ( ) 2 * 2 15 ( ) 2 = ( ) 10

The end of Solution Homework_ch12 Teacher assistant: