15 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.

Slides:



Advertisements
Similar presentations
Abdullah Said Alkalbani University of Buraimi
Advertisements

Date of Birth Design Problem
Counters and Registers
Looking Inside the Black Box
CSE 370 Sample Final Exam Questions. 1) Logic Minimization CD AB F = Σm(0,6,7,8,9,11,15) + d(1,13)
Register Transfer and Microoperations Part2
Principles & Applications
Binary Numbers.
8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Department of Computer Science and Information Systems Autumn 2013 Preliminary.
22 February 2013Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems.
11 January 2013Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems.
18 January 2013Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems.
8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
22 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
Introduction to Computer Systems
15 February 2013Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems.
1 March 2013Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems
8 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
8 March 2013Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems
Introduction to Programming
25 March 2013Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems
8 February 2013Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems.
29 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
1 Floating Point Representation and Arithmetic (see Patterson Chapter 4)
A Simple ALU Binary Logic.
B261 Systems Architecture
Question (from exercises 2) Are the following sources likely to be stationary and ergodic? (i)Binary source, typical sequence aaaabaabbabbbababbbabbbbbabbbbaabbbbbba......
EET260: A/D and D/A conversion
Monika Gope Lecturer IICT, KUET
Truth Tables & Logic Expressions
Logic Gates & Circuits. AND Gate Input AInput BOutput X AND Logic Gate AND Truth Table X = A. B AND Boolean Expression.
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)
CS1022 Computer Programming & Principles
Nat 4/5 Computing Science Lesson 1: Binary
Binary Lesson 3 Hexadecimal. Counting to 15 Base Base Base 16 Base Base Base 16 Two Ten (Hex) Two Ten (Hex)
Binary Lesson 3 Hexadecimal. Counting to 15 Base Base Base 16 Base Base Base 16 Two Ten (Hex) Two Ten (Hex)
Digital Logic & Design Lecture No. 3. Number System Conversion Conversion between binary and octal can be carried out by inspection.  Each octal digit.
ELECTRONICS TECHNOLOGY Digital Devices I Karnaugh Maps
1/15/2015 Slide # 1 Binary, Octal and Hex Numbers Copyright Thaddeus Konar Introduction to Binary, Octal and Hexadecimal Numbers Thaddeus Konar.
Number Systems Decimal Binary Denary Octal Hexadecimal Click the mouse or Press the space bar to Continue.
Min terms and logic expression
Internet Engineering Czesław Smutnicki Discrete Mathematics – Combinatorics.
Introduction to Computer Systems
2.3) Example of program execution 1. instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register.
CSCI 3 CH 1.6. REMINDER Remember to put your Student ID # on your homework Remember to put your Student ID # on your homework If you are not going to.
Simple Data Type Representation and conversion of numbers
Introduction to Computer Systems
Digital Logic Design Lecture 3 Complements, Number Codes and Registers.
6 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
Chapter 2: The Logic of Compound Statements 2.5 Application: Number Systems and Circuits for Addition 1 Counting in binary is just like counting in decimal.
6 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
29 September 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.6 Instructor: Lin Chen Sept 2013.
Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems
20 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
13 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
3 November 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
17 November 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
IT1004: Data Representation and Organization Negative number representation.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
In decimal we are quite familiar with placing a “-” sign in front of a number to denote that it is negative The same is true for binary numbers a computer.
27 October 2015 Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
Lecture 2: 8/29/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
Department of Computer Science Georgia State University
Fundamentals of Computer Science
Introduction to Computer Systems
CSC 220: Computer Organization Signed Number Representation
Presentation transcript:

15 October 2013Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems Autumn 2013 Week 3a: Number Representations

Recap: Programs A program is a sequence of instructions. The instructions may refer to memory cells which store values such as integers. In Toms computer the memory cells are the boxes. Each memory cell has an address and contents. 15 October 2013Birkbeck College, U. London2

Recap: Running a Program The instructions of the program are executed one by one. When an instruction is executed, the values in the memory cells may change. When the program halts the output is usually the values of one or more memory cells. 15 October 2013Birkbeck College, U. London3

Recap: Variables Here is a typical statement in a programming language: q=0; Left hand side: the name q of a variable Right hand side: an expression Execution: evaluate the right hand side to obtain a number. Store the number in a box named q. 15 October 2013Birkbeck College, U. London4

15 October 2013Birkbeck College, U. London5 Exercise from Week 2 Sketch an algorithm that takes as input a strictly positive integer n and outputs an integer k such that

15 October 2013Brookshear, Section 1.66 Representations of Negative Integers Put a minus sign in front of the representation for a positive integer. Excess notation. Twos Complement notation – the most popular representation for negative integers in computers.

15 October 2013Brookshear, Section 1.67 Excess Notation Problem: represent a set of positive and negative integers using bit strings with a fixed length n. Represent 0 by 10…0 (n bits). Represent positive numbers by counting up from 10…0 in standard binary notation. Represent negative integers by counting down from 10…0 in standard binary notation.

15 October 2013Brookshear, Section 1.68 Example of Excess Notation n=

Examples Find the 6 bit excess notation for the decimal numbers 7 and -6. Which decimal number has the 5 bit excess notation October 2013Birkbeck College, U. London9

15 October 2013Birkbeck College, U. London10 Twos Complement Notation Form the bit string 10…0 with n+1 bits. Represent 0 by the last n bits of 10…0. Represent positive integers by counting up from 10…0 in standard binary notation and using the last n bits. Represent negative integers by counting down from 10…0 in standard binary notation and using the last n bits.

15 October 2013Brookshear, Section Example of Twos Complement Notation n=4 The left most bit indicates the sign.

15 October 2013Brookshear, Section Addition and Subtraction In the twos complement system subtraction reduces to addition. E.g. to evaluate 6-5 in 4 bit twos complement notation, add the tc bit strings for 6 and –5, then take the four rightmost bits === ==

15 October 2013Brookshear, Section Explanation The bit strings for TC[6] and TC[-5] are the rightmost four bits of Binary[2 4 +6] and Binary[2 4 -5], respectively. The bit strings TC[6], TC[-5] are added as if they were binary numbers. The rightmost four bits of the result equal the rightmost four bits of Binary[(2 4 +6)+(2 4 -5)]= Binary[ ]. The right most four bits of Binary[ ] are the bit string for TC[1].

Why Use Twos Complement Addition and subtraction require one circuit for addition and one circuit for negation. This is more efficient than having a circuit for addition and a circuit for subtraction. 15 October 2013Brookshear, Section 1.614

15 October 2013Brookshear, Section Twos Complement Notation for m and -m Suppose TC[m] = s || 1 || t, where t is a string of zeros. Then TC[-m]=Complement[s]||1||t. Proof: the rightmost n bits of TC[m]+TC[-m] are all zero. Example: n=4, TC[3]=0011, TC[-3]=1101.

15 October 2013Birkbeck College, U. London16 Example Find the 5 bit twos complement representations for the decimal integers 5 and -5.