Computation & Machine, Ancient to Modern Review

Slides:



Advertisements
Similar presentations
2-1 Chapter 2 - Data Representation Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
Advertisements

Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
Chapter 2 : Number System
1 Lecture 3 Bit Operations Floating Point – 32 bits or 64 bits 1.
Signed Numbers.
1 Module 2: Floating-Point Representation. 2 Floating Point Numbers ■ Significant x base exponent ■ Example:
The IEEE Format for storing float (single precision) data type Use the “enter” key to proceed through the show.
Number Systems Lecture 02.
School of Computer Science G51CSA 1 Computer Arithmetic.
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Binary numbers and arithmetic. ADDITION Addition (decimal)
Chapter3 Fixed Point Representation Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
Data Representation Number Systems.
© Janice Regan, CMPT 128, Jan CMPT 128: Introduction to Computing Science for Engineering Students Integer Data representation Addition and Multiplication.
Simple Data Type Representation and conversion of numbers
MATH 224 – Discrete Mathematics
Numeral Systems Subjects: Numeral System Positional systems Decimal
Information Representation (Level ISA3) Floating point 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.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Negative and Floating Point.
Computer Science 111 Fundamentals of Programming I Number Systems.
Computing Systems Basic arithmetic for computers.
Computer Architecture
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
Data Representation.
S. Rawat I.I.T. Kanpur. Floating-point representation IEEE numbers are stored using a kind of scientific notation. ± mantissa * 2 exponent We can represent.
Calculating Two’s Complement. The two's complement of a binary number is defined as the value obtained by subtracting the number from a large power of.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
ECEN 301Discussion #19 – Binary Numbers1 Numbered Moses 1:33,35,37 33 And worlds without number have I created; and I also created them for mine own purpose;
Computation & Machine, Ancient to Modern
The Teacher CP4 Binary and all that… CP4 Revision.
CSC 221 Computer Organization and Assembly Language
DATA REPRESENTATION, DATA STRUCTURES AND DATA MANIPULATION TOPIC 4 CONTENT: 4.1. Number systems 4.2. Floating point binary 4.3. Normalization of floating.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Floating Point Representation.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall
Floating-Point Representation We can store integers and characters easily in binary, but what about fractions? ¼ =.25 = 2.5 * *
Computer Organization and Design Information Encoding II Montek Singh Wed, Aug 29, 2012 Lecture 3.
07/12/ Data Representation Two’s Complement & Binary Arithmetic.
Digital Logic Lecture 3 Binary Arithmetic By Zyad Dwekat The Hashemite University Computer Engineering Department.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.6 Instructor: Lin Chen Sept 2013.
SAK Chapter 21 Chapter 2 : Number System 2.1 Decimal, Binary, Octal and Hexadecimal Numbers 2.2 Relation between binary number system with other.
1 Information Representation in Computer Lecture Nine.
IT1004: Data Representation and Organization Negative number representation.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Data Representation COE 301 Computer Organization Dr. Muhamed Mudawar
Lecture No. 4 Computer Logic Design. Negative Number Representation 3 Options –Sign-magnitude –One’s Complement –Two’s Complement  used in computers.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
CPIT 201 King AbdulAziz University Faculty of Computing & Information Technology Information Technology Department CH 2 Number Systems CPIT 201 Introduction.
COSC2410: LAB 2 BINARY ARITHMETIC SIGNED NUMBERS FLOATING POINT REPRESENTATION BOOLEAN ALGEBRA 1.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
Floating Point Representations
Fundamentals of Computer Science
Data Representation COE 308 Computer Architecture
Data Representation ICS 233
Data Representation.
Introduction To Computer Science
Data Structures Mohammed Thajeel To the second year students
Data Representation Data Types Complements Fixed Point Representation
Data Representation ICS 233
Prof. Giancarlo Succi, Ph.D., P.Eng.
Recent from Dr. Dan Lo regarding 12/11/17 Dept Exam
Data Representation COE 308 Computer Architecture
Presentation transcript:

Computation & Machine, Ancient to Modern Review GEK1536 Computation & Machine, Ancient to Modern Review

Aim, Objective, Syllabus Numbers and their representations Historic perspective of computation Primitive computing tools (abacus, sliding rule, etc) Development of digital computer and programming language Future computing machines

Egyptian Numerals Egyptian number system is additive.

Roman Numerals I 1 II 2 III 3 IV 4 V 5 VI 6 VII 7 VIII 8 IX 9 X 10 C 100 D 500 M 1000 MMMDCCCLXXVIII 3878

Mesopotamia Civilization Above: Babylonian sexagesimal (base 60) number. It is the first positional number system. Left: Oldest cuneiform writing by Sumerian. Cunneiform [‘kjuniifom] Sumerian [sumirean]

Positional Number System A unique mapping from the digits to the number Most common bases are b=10 (decimal), b=2 (binary), b=60 (sexagesimal) Fractions can be represented if we allow for negative powers of b.

Mixed Radix System Let p1 < p2 < p3 < … be set of prime numbers Then we can uniquely represent an integer

Abaci Methods of addition, subtraction and multiplication with Roman counting boards. Doubling method for multiplication. M C X I Boethius (Hindu-Arabic) vs Pythagoras (counting board)

Logarithm and Slide Rule John Napier of Scotland developed the concept of logarithm around AD 1600. He also invented so-called Napier’s bones. Slide rule based on the property of logarithm was invented in the late 1700s. Slide rule page http://www.ies.co.jp/math/java/misc/slide_rule/slide_rule.html If ay=x, then y = logax log (u v) = log (u) + log(v)

Charles Babbage Difference Engine is based on finite difference. A machine that can calculate a table of polynomial functions such as T(x)=x2+x+41. ∆f(x) = f(x+h) – f(x)

Modern Computer and Programming #include <stdio.h> main() { int a, b, c; printf(“Hello\n”); a=1; b = 2; c = a + b; printf(“c=%d”, c); return; } for( … ), while( … ), if, scanf, printf, etc int, float, char, double

Turing Machine A Turing Machine includes a head moving on a tape, an internal state, and instructions. Any computer can be made to be equivalent to a Turing machine. Turing machine is a concept, not a real machine. It is used for the theoretical analysis of computation.

Binary Number System for Digital Computer 0000 0111 7 0100 1000 H 0000 1000 8 0100 1001 I 0011 1110 1000 0000 0000 0000 0000 0000 0.25 character integer Biased Exponent sign IEEE float-point number Fractional part Two’s complement

Quantum Computing

Problem 1 For each of the possible alternative statements, choose the one best fit the fact. (i) Babylonian base-60 number system is first used around (a) 5000 BC, (b) 2000 BC, (c) 11 AD, (d) 1000 AD. (ii) The ancient Greeks developed (a) base-20 system, (b) algebra, (c) geometry, (d) science. (iii) The Napier’s bones are (a) toys for dogs, (b) for simplifying addition, (c) aid for multiplication, (d) for computing logarithms. (iv) Babbage’s difference machine computes value of (a) differences, (b) sums, (c) polynomials, (d) divisions. (v) A quantum computer relies on (a) uncertainty principle, (b) deterministic principle, (c) quantitative principle, (d) superposition principle. b,c,c,c,d

Problem 2 With one or two sentences, briefly describe the following concepts: two’s complement positional number system register overflow punched cards

Problem 3 In Euclidean geometry, sum of the three internal angles of a triangle is 180. (a) based on this fact, derive the sum of the 4 internal angles of a quadrilateral (a four sided polygon). (b) Generalize the derivation in part (a), derive a formula for the sum of internal angles for an n-sided polygon, for any n = 3, 4, 5, …

Solution (a) Total 360 A quadrilateral can be viewed as 2 triangles 180 180 A quadrilateral can be viewed as 2 triangles (b) To get an n-sided polygon, you can add a triangle to one of side of an (n-1)-sided polygon. So the sum of the angles is 180(n-2). 180 180

Problem 4 Design a Turing machine to determine if a binary encoded natural number is even or odd. When the machine halts, it erases the number on the tape and replaces it with the answer 0∆∆∆∆… if the number is even, or 1∆∆∆∆…, if the number is odd. The input number is put on tape with the least significant bit in the first cell [That is, we read the tape backward]. The symbol space will be 0, 1, the space ∆, and an extra dot . The Turing machine rules will be specified by a diagram.

Solution (0,0,R) (0,∆,R) (∆,∆,R) 1 start 3 halt 2 (1,1,R) (1,∆,R)

Problem 5 (a) Convert the decimal number 255.125 into IEEE 32-bit single precision floating-point format. Note that the format has the highest bit for the sign, the next 8 bits for a biased exponent (the bias is 127), the rest of the bits for the fractional part of the number. (b) Interpret the following bit pattern 0011 1111 1111 1111 1111 1111 1111 1111 in three ways (i) unsigned integer, (ii) signed integer, and (iii) floating point number (IEEE format). Find the three values in decimal notation.

Solution 25510=1111 11112, 0.12510 = 1/8 = 0.0012, so 255.12510=11111111.0012= 1.111111100127 f=.11111110010000…0 E=7+127=134=0111 111 + 111 = 1000 01102 s = + = 0 (positive) So the bit pattern is 0 1000 0110 1111111001 0000000000 000 (i) and (ii) +230-1=1073741823. (iii) s=0, E=127, so e=0, f = 1.1111….12= 2 – 2-23=1.99999988079 = value of the IEEE number.

Problem 6 There are several ways that one can use to convert a decimal integer into binary digits. One possibility is to subtract a power of 2, starting from the largest. In this way, the most significant bit is found first and can be printed out. Implement this idea in a C program. The program first scans (that is, read) a non-negative integer. It then prints out the binary digits from most significant to least significant, one digit a time.

Solution #include <stdio.h> main() { int i, n; scanf(“%d”, &n); while(i<n) { /* find largest power */ i = i*2; } while(i > 0) { /* subtract power, from large to small */ if(n-i>=0) { printf(“1”); n = n – i; } else { printf(“0”); i = i/2; printf(“\n”);

Reminder Final examination on 9:00-11:00, Thursday, 27 April 06