Wednesday, January 28, 2018
|
|
- Curtis Shepherd
- 5 years ago
- Views:
Transcription
1 Wednesday, January 28, 2018 Topics for today History of Computing (brief) Encoding data in binary Unsigned integers Signed integers Arithmetic operations and status bits Number conversion: binary to/from decimal Other number systems: Binary-coded decimal, Gray codes Brief coverage of history of computing Programmable Devices Computing Devices (1837) Babbage's Analytical Engine (designed but not built 1 ) was the first programmable calculator. Prior to that date there had been: programmable devices (e.g. music boxes, weaving looms) calculators (e.g., abacuses and simple machines devised by Pascal and by Leibnitz) but nothing that combined programming with calculation. Babbage s machine had components that we can map to elements of modern computers, for example, store (memory) and mill (processor). His collaborator, Ada Countess of Lovelace (Lord Byron s daughter), summed up the capabilities of the machine: It can do whatever we know how to order it to perform Developments included the punched card (Hollerith) which helped speed up the tabulation of the 1890 census. Later widely used as input medium for computers. (early 1940s) Computers were programmed externally by inserting wires into plugboards. See, for example, 1 The Difference Engine by William Gibson and Bruce Sterling is an alternative-history novel in which Babbage engines play a large part. William Gibson is also the coiner of the term cyberspace. Comp 162 Notes Page 1 of 15 January 24, 2018
2 (1945) John von Neumann (and others) published a design for a stored program computer. The idea of storing the instructions for processing the data along with the data itself in the same memory may not have originated with von Neumann but his name is now associated with the concept. Having the program stored in internal memory leads to (a) (b) (c) the possibility of a program modifying its own instructions - see examples of this later in the course need for a "program counter" - some mechanism to remember where the next instruction is counter is misleading, pointer would be better. bottleneck in memory access when CPU is both getting instructions and reading/writing data from the same memory. Harvard architecture A computer system that uses the Harvard architecture stores instructions and data in separate memories. (Named after an IBM system at Harvard in the 1940s that used tape for instructions and electro-mechanical counters for data.) This separation allows a CPU to write the results of one instruction to data memory while reading the next instruction from instruction memory. The memories may have different components: the instruction memory might be read-only (ROM) and the data memory might be read-write (RAM). Since 1945 the technology used to implement the von Neumann model has changed from valves to transistors to integrated circuits to LSI (large-scale integration) to VLSI (very large scale integration) but the basic mode of operation is the same. What does the future hold? Probably increased throughput (operations per second) achieved through parallelism. Multicore processors are becoming ubiquitous more than one CPU packaged on the same chip perhaps sharing some part of the memory. It is common for CPUs to use pipelining overlapping the processing of instructions. So rather than complete the fetch-decode-execute phases of one instruction before starting the next, the phases are overlapped (think car assembly line). The world's most powerful systems (see ) typically have millions of cores. Here are the top 5 systems in the latest list (November 2017). The Japanese system is a new entry in the top 5 2. In recent years, the top of the list has changed relatively slowly. The Wikipedia Top500 article has more detail and background. 2 The Japanese and Swiss systems are the only top 10 systems to appear also in the top 10 of the Green 500. Comp 162 Notes Page 2 of 15 January 24, 2018
3 System Location Cores Max Petaflops Power Consumption (Kwatts) TaihuLight China 10,649, Tianhe-2 China 3,120, Piz Daint Switzerland 361, Gyoukou Japan 19,860, Titan Oak Ridge 560, The June 2008 list was the first in which the top system is rated at more than 1 Petaflop (10 15 floating point operations per second). A challenge is to design software that can take advantage of the hardware. Non Von Neumann systems Systems that do not follow the von Neumann model have been investigated Dataflow Computer In a dataflow computer, tokens flow along a graph. Many tokens can be active at once. See Quantum Computing Rather than using bits (binary digits), which are either 1 or 0, a quantum computer uses qubits (quantum bits) which can be in both states at the same time. A quantum computer can perform the equivalent of many conventional operations simultaneously and may be able to solve problems that cannot be solved in reasonable time on a conventional computer. This technology is still in its infancy. Applications in cryptography are likely to be significant. Comp 162 Notes Page 3 of 15 January 24, 2018
4 Chapter 3 Given our stored program model, we need to find ways to represent in memory both data items and program instructions. We can classify items to be represented as follows Data Numeric Non-numeric Integer Real Booleans, Unsigned, Fixed point, Characters, Signed Floating point Strings Instructions Machine-specific Instructions tend to be specific to particular processors so we will look at them later. Data items will include integers, characters, real numbers and Booleans (true/false values). Because it is easier to build devices that are stable in each of 2 states rather than stable in each of 10 states, we use binary devices rather than decimal devices to store information. Hence there is a need to devise mappings of our data types onto binary. Typically we will have a fixed number of binary digits (bits) in which to store a data item. We start with integers then look at characters. We postpone discussion of floating point (real) numbers until later in the course because Pep/9 does not have instructions for operating on floating point numbers. Unsigned integers (section 3.1) We use normal base N ideas. Base 2 numbers (1 upwards) are 1, 10, 11, 100, 101, 110, 111, 1000, and so on. If we have a storage device with N binary digits (bits) then we can store 2 N different numbers. Typically we choose to store 0 through 2 N -1. So if we have 8 bits we can store if we have 12 bits we can store if we have 16 bits we can store and so on. When we add two unsigned numbers, a carry out of the most significant stage of the addition is an indication of an error. It means that the true result of the addition is outside the range that we can represent. For example, if N is 5, our range of representable numbers is so an attempt to add 19 and 15 is not going to work. Comp 162 Notes Page 4 of 15 January 24, 2018
5 (19) (15) (1) (2!!) The conversion ideas between decimal and binary (see number conversion below) also work for other bases. Swiss train control Or, presumably, a multiple thereof. Signed integers (section 3.2) There are a variety of schemes for mapping numbers that might be positive or negative. The schemes mostly differ in the way that they represent negative numbers. There is a trade-off between simplicity of the system and complexity of the circuitry that would be needed to perform addition and subtraction. For example, a very simple system would use the first bit to hold the sign of a number and the remaining bits to hold its magnitude (see Sign and magnitude below) but a corresponding adder circuit would be relatively complex. The most commonly used scheme is termed "two's complement" in which -1 is represented by is represented by and so on. This seems like a good choice because when we add 1 ( ) to -1 ( ) we get zero ( ); similarly for 2 and -2 and so on.. Here is a complete two s complement table for 4-bit storage Comp 162 Notes Page 5 of 15 January 24, 2018
6 Bit pattern Represents Note that the representation of a negative number begins with 1 and the representation of a positive number begins with a 0 so we can still treat the leftmost bit as a sign bit. However, also note that just changing that bit will not negate a number. To find the representation of -K in the two's complement scheme: Method 1 Method 2 Find the representation of +K (regular base 2 number) change all the bits add 1 take the representation of +K working right to left, leave unchanged all the bits up to and including the first "1" change the remaining bits. You can check that these two methods both give the same result (for example, in our 5-bit scheme, -5 is 11011). Two s complement is a popular system because the circuitry to perform arithmetic operations on two s complement numbers is relatively simple. No special tests are needed on the incoming numbers to see if they are positive or negative. Consider our 5-bit example again and the addition of 5 and -1. Comp 162 Notes Page 6 of 15 January 24, 2018
7 (5) (-1) (1) (4) The usual protocol for adding base 2 numbers gives the correct result. Recall that when we added unsigned numbers and got a carry out, this indicated overflow. The same is not true when we add signed numbers the carry is not an indication of error (more on this later). The range of numbers that we can store in an N-bit object using the two s complement scheme is -2 N-1 through 2 N-1-1 So for our 5-bit storage this translates to -16 to +15. An 8-bit byte can store -128 to +127 A 16-bit register can store to A 32-bit register can store to Comp 162 Notes Page 7 of 15 January 24, 2018
8 There are schemes other than two s complement for representing signed integers. We do not look at them in detail; the following table of 4-bit patterns is just for information, it shows how the bit patterns are used in each scheme. Two s complement One s complement Sign and magnitude Excess Magnitude Features: One's complement has fast negation (just change all the bits) but two representations for zero and also an end-around-carry operation needed during addition. E.g (3) (-1) ---- (1) 0001 add the carry to get the final result 0010 (2) "Sign and magnitude" and "excess magnitude" are both difficult to design addition circuitry for but each may have other advantages - see floating point later in the semester. Subtraction. Doing subtraction by hand in binary is awkward. But there is no need for the CPU to have a separate subtract circuit in a two's complement machine because A - B = A + (-B) = A + B' + 1 (where B' represents the inverse or one's complement of B) Comp 162 Notes Page 8 of 15 January 24, 2018
9 Y2.038K On some Unix TM systems, the time of day is held as a 32-bit signed integer representing the number of seconds since 12:00AM GMT on January 1 st The largest value that can be held is which is (about 68 years worth of seconds). Adding 1 to this number will give us a large negative number and apparently set the clock back to December This will happen at 3:14:08 on January 19, Had unsigned integers been used instead, the overflow problem would occur in The Wikipedia article has an illustration of the rollover. Arithmetic operations and status bits Q: What happens if we try to perform an operation on signed integers where the true result is outside the range we can represent? A: We get overflow. Q: How do we detect overflow? A: It is not quite as simple as looking for a carry out of the most significant stage as we did with unsigned numbers. In the case of addition, we can only get overflow if we are adding two numbers with the same sign (if we add one positive and one negative number we cannot get overflow). Overflow is indicated by the sign bit of the result being different to what we would expect, i.e., if we add two positive numbers and get a negative result or add two negative numbers and get a positive result. In contrast to operations on unsigned numbers, getting a carry out of the mostsignificant stage is not an error. The Arithmetic and Logic Unit inside a typical computer gives us 4 indicators (status bits) when we do an arithmetic or logical operation. Each indicator is 1 or 0 (true or false). Input 1 Input 2 N Operation ALU Z Select V C Result Comp 162 Notes Page 9 of 15 January 24, 2018
10 N - the result was negative Z - the result was zero C - there was a carry out from the most significant stage V - there was overflow (=error) We will look at some examples next time. Number conversions for integers and fractions (1) binary to decimal (a) if number is positive, add the weights of digits thus = = 26 decimal same applies if number is a fraction. Weights of digits after the binary point are 0.5, 0.25, and so on = (b) if number is signed and negative, convert the negation (assume 2 s complement) Negating gives = = 17 So original number was -17. same applies if number is a fraction. (2) decimal to binary Negating gives = So original number was (a) if number is positive, repeatedly divide by 2 and keep track of the remainders. E.g. 167 / 2 = 83 remainder 1 83 / 2 = 41 remainder 1 41 / 2 = 20 remainder 1 20 / 2 = 10 remainder 0 10 / 2 = 5 remainder 0 5 / 2 = 2 remainder 1 2 / 2 = 1 remainder 0 1 / 2 = 0 remainder 1 Thus 167(decimal) is (binary) (read up the column of remainders) Comp 162 Notes Page 10 of 15 January 24, 2018
11 if the number is negative, make it positive, convert it then negate the binary. E.g., -167 with a 9-bit representation -167 => 167 => => => (b) we can convert a decimal fraction to binary but note that few decimal fractions have an exact binary representation. To convert, multiply (just the) fraction part by 2. Example * 2 = * 2 = * 2 = * 2 = 0.75 * 2 = 1.5 * 2 = 1.0 * 2 = (decimal) is (binary) (read down the column of digits before the decimal point). This is 19/64. If the fraction is negative, make it positive, convert it then negate the binary. E.g => * 2 = * 2 = * 2 = * 2 = 1.5 * 2 = 1.0 * 2 = 0.0 Fraction is Negative gives Other number representations: Binary-coded decimal The decimal digits 0 through 9 could be encoded using 4 bits 0000 to Thus each requires just a nybble (half a byte). One way to code a decimal number is then to map each decimal digit onto a nybble. So, for example, 4385 would be represented Advantages: input/output would be quite efficient. Disadvantages: representation of negative numbers, arithmetic operations would be complex. Comp 162 Notes Page 11 of 15 January 24, 2018
12 There are many variations on coding decimal numbers in this way Other number representations: Binary-reflected (Gray) code A disadvantage of a numbering system such as two s complement is that incrementing a counter often requires changes in multiple bit positions. For example, 7 => => If the counter is sampled during such transitions, a spurious result may be obtained because the bit positions may not change simultaneously. Similarly, an N-bit object representing the angle of a rotating device may also give spurious readouts if the angle is represented using 2 s complement. A Gray code (after Frank Gray) is an ordering of the integers in which only one bit position changes between successive numbers. It is also cyclic in that incrementing the last number gives us the first one. The table below shows how an N-bit Gray code can be constructed by reflecting the (N-1)-bit code then prepending 0 to the first half and 1 to the second. N=1 Reflected N=1 N=2 Reflected N=2 N=3 Reflected N=3 N= Comp 162 Notes Page 12 of 15 January 24, 2018
13 Reading The topics covered today are, for the most part, in Chapter 3. Next we will look at status bit examples and more topics from Chapter 3: logical operations such as AND, OR and EXOR shift operations which are also classified as logical operators hexadecimal (base 16 notation) notation. how characters are commonly represented (section 3.4). We will also look at Huffman codes. These are variable-length codes. The topic is not covered in the book but there will be links on the course page to sites describing Huffman codes. Comp 162 Notes Page 13 of 15 January 24, 2018
14 Review Questions 1. A 5-bit unsigned binary counter is counting down to zero. Unfortunately, it doesn t stop at zero. What does the display show next? 2. In signed binary, what is the largest 3-bit, 5-bit, N-bit number expressed in binary? 3. Suppose the Unix designers had chosen to use a 48-bit signed integer instead of a 32-bit to count seconds. How you could you calculate when the time rollover would occur? 4. In a 5 bit Gray code, what number follows 11010? 5. If Swiss locomotives and wagons all have 4 axles and each is 20 meters long, how long is the shortest ghost train? 6. Your computer uses the 2 s complement system. How would you describe the binary representation of Put the following 6-bit two s complement numbers in the appropriate boxes below Odd Positive Negative Even Comp 162 Notes Page 14 of 15 January 24, 2018
15 Review answers , 01111, 0 followed by N-1 1s 3. Problem arises 2 47 seconds after base time, i.e seconds or / (60*60*24) days or some time around the year 4,473, Reflect the 4-bit code to get the 5-bit code So the answer is Problem arises when train has 256 axles which translates to 64 locos/wagons. Total length would be 1280 meters. 6. All bits are 1 7. Positive Negative Odd Even Comp 162 Notes Page 15 of 15 January 24, 2018
Monday, January 27, 2014
Monday, January 27, 2014 Topics for today History of Computing (brief) Encoding data in binary Unsigned integers Signed integers Arithmetic operations and status bits Number conversion: binary to/from
More informationData Representation Type of Data Representation Integers Bits Unsigned 2 s Comp Excess 7 Excess 8
Data Representation At its most basic level, all digital information must reduce to 0s and 1s, which can be discussed as binary, octal, or hex data. There s no practical limit on how it can be interpreted
More informationMACHINE LEVEL REPRESENTATION OF DATA
MACHINE LEVEL REPRESENTATION OF DATA CHAPTER 2 1 Objectives Understand how integers and fractional numbers are represented in binary Explore the relationship between decimal number system and number systems
More informationA complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation
Complement Number Systems A complement number system is used to represent positive and negative integers A complement number system is based on a fixed length representation of numbers Pretend that integers
More informationDigital Fundamentals
Digital Fundamentals Tenth Edition Floyd Chapter 2 2009 Pearson Education, Upper 2008 Pearson Saddle River, Education NJ 07458. All Rights Reserved Decimal Numbers The position of each digit in a weighted
More informationBits, Words, and Integers
Computer Science 52 Bits, Words, and Integers Spring Semester, 2017 In this document, we look at how bits are organized into meaningful data. In particular, we will see the details of how integers are
More informationReview of Number Systems
Review of Number Systems The study of number systems is important from the viewpoint of understanding how data are represented before they can be processed by any digital system including a digital computer.
More informationSigned Binary Numbers
Signed Binary Numbers Unsigned Binary Numbers We write numbers with as many digits as we need: 0, 99, 65536, 15000, 1979, However, memory locations and CPU registers always hold a constant, fixed number
More informationWednesday, September 13, Chapter 4
Wednesday, September 13, 2017 Topics for today Introduction to Computer Systems Static overview Operation Cycle Introduction to Pep/9 Features of the system Operational cycle Program trace Categories of
More informationMachine Architecture and Number Systems CMSC104. Von Neumann Machine. Major Computer Components. Schematic Diagram of a Computer. First Computer?
CMSC104 Lecture 2 Remember to report to the lab on Wednesday Topics Machine Architecture and Number Systems Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number
More informationDLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR
UNIT I Digital Systems: Binary Numbers, Octal, Hexa Decimal and other base numbers, Number base conversions, complements, signed binary numbers, Floating point number representation, binary codes, error
More informationCHW 261: Logic Design
CHW 261: Logic Design Instructors: Prof. Hala Zayed Dr. Ahmed Shalaby http://www.bu.edu.eg/staff/halazayed14 http://bu.edu.eg/staff/ahmedshalaby14# Slide 1 Slide 2 Slide 3 Digital Fundamentals CHAPTER
More informationNumber System. Introduction. Decimal Numbers
Number System Introduction Number systems provide the basis for all operations in information processing systems. In a number system the information is divided into a group of symbols; for example, 26
More informationWednesday, September 6, 2017
Wednesday, September 6, 2017 Topics for today Arithmetic operations and status bits Logical operators Introduction to bigger bases Encoding characters Coding in general Status bits We saw last time that
More informationWorld Inside a Computer is Binary
C Programming 1 Representation of int data World Inside a Computer is Binary C Programming 2 Decimal Number System Basic symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Radix-10 positional number system. The radix
More informationWednesday, February 4, Chapter 4
Wednesday, February 4, 2015 Topics for today Introduction to Computer Systems Static overview Operation Cycle Introduction to Pep/8 Features of the system Operational cycle Program trace Categories of
More informationMachine Architecture and Number Systems
Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting from Binary to Decimal Converting from Decimal
More informationComputer Organization and Levels of Abstraction
Computer Organization and Levels of Abstraction Announcements Today: PS 7 Lab 8: Sound Lab tonight bring machines and headphones! PA 7 Tomorrow: Lab 9 Friday: PS8 Today (Short) Floating point review Boolean
More informationBINARY SYSTEM. Binary system is used in digital systems because it is:
CHAPTER 2 CHAPTER CONTENTS 2.1 Binary System 2.2 Binary Arithmetic Operation 2.3 Signed & Unsigned Numbers 2.4 Arithmetic Operations of Signed Numbers 2.5 Hexadecimal Number System 2.6 Octal Number System
More information9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation
Data Representation II CMSC 313 Sections 01, 02 The conversions we have so far presented have involved only unsigned numbers. To represent signed integers, computer systems allocate the high-order bit
More informationSoftware and Hardware
Software and Hardware Numbers At the most fundamental level, a computer manipulates electricity according to specific rules To make those rules produce something useful, we need to associate the electrical
More informationVon Neumann Architecture
Von Neumann Architecture Assist lecturer Donya A. Khalid Lecture 2 2/29/27 Computer Organization Introduction In 945, just after the World War, Jon Von Neumann proposed to build a more flexible computer.
More informationLogic, Words, and Integers
Computer Science 52 Logic, Words, and Integers 1 Words and Data The basic unit of information in a computer is the bit; it is simply a quantity that takes one of two values, 0 or 1. A sequence of k bits
More informationDec Hex Bin ORG ; ZERO. Introduction To Computing
Dec Hex Bin 0 0 00000000 ORG ; ZERO Introduction To Computing OBJECTIVES this chapter enables the student to: Convert any number from base 2, base 10, or base 16 to any of the other two bases. Add and
More informationDigital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.
Digital Logic 1 Data Representations 1.1 The Binary System The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer. The system we
More informationNumber Systems for Computers. Outline of Introduction. Binary, Octal and Hexadecimal numbers. Issues for Binary Representation of Numbers
Outline of Introduction Administrivia What is computer architecture? What do computers do? Representing high level things in binary Data objects: integers, decimals, characters, etc. Memory locations (We
More informationIntegers. N = sum (b i * 2 i ) where b i = 0 or 1. This is called unsigned binary representation. i = 31. i = 0
Integers So far, we've seen how to convert numbers between bases. How do we represent particular kinds of data in a certain (32-bit) architecture? We will consider integers floating point characters What
More informationUNIT 7A Data Representation: Numbers and Text. Digital Data
UNIT 7A Data Representation: Numbers and Text 1 Digital Data 10010101011110101010110101001110 What does this binary sequence represent? It could be: an integer a floating point number text encoded with
More informationCS & IT Conversions. Magnitude 10,000 1,
CS & IT Conversions There are several number systems that you will use when working with computers. These include decimal, binary, octal, and hexadecimal. Knowing how to convert between these number systems
More informationChapter 1 Review of Number Systems
1.1 Introduction Chapter 1 Review of Number Systems Before the inception of digital computers, the only number system that was in common use is the decimal number system which has a total of 10 digits
More informationRepresentation of Non Negative Integers
Representation of Non Negative Integers In each of one s complement and two s complement arithmetic, no special steps are required to represent a non negative integer. All conversions to the complement
More informationAdvanced Computer Architecture-CS501
Advanced Computer Architecture Lecture No. 34 Reading Material Vincent P. Heuring & Harry F. Jordan Chapter 6 Computer Systems Design and Architecture 6.1, 6.2 Summary Introduction to ALSU Radix Conversion
More informationPART A (22 Marks) 2. a) Briefly write about r's complement and (r-1)'s complement. [8] b) Explain any two ways of adding decimal numbers.
Set No. 1 IV B.Tech I Semester Supplementary Examinations, March - 2017 COMPUTER ARCHITECTURE & ORGANIZATION (Common to Electronics & Communication Engineering and Electronics & Time: 3 hours Max. Marks:
More informationBinary. Hexadecimal BINARY CODED DECIMAL
Logical operators Common arithmetic operators, like plus, minus, multiply and divide, works in any number base but the binary number system provides some further operators, called logical operators. Meaning
More informationNumber Systems. Both numbers are positive
Number Systems Range of Numbers and Overflow When arithmetic operation such as Addition, Subtraction, Multiplication and Division are performed on numbers the results generated may exceed the range of
More informationSigned umbers. Sign/Magnitude otation
Signed umbers So far we have discussed unsigned number representations. In particular, we have looked at the binary number system and shorthand methods in representing binary codes. With m binary digits,
More informationAgenda EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 1: Introduction. Go over the syllabus 3/31/2010
// EE : INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN Lecture : Introduction /9/ Avinash Kodi, kodi@ohio.edu Agenda Go over the syllabus Introduction ti to Digital it Systems // Why Digital Systems?
More informationRegister Transfer and Micro-operations
Register Transfer Language Register Transfer Bus Memory Transfer Micro-operations Some Application of Logic Micro Operations Register Transfer and Micro-operations Learning Objectives After reading this
More informationDigital Fundamentals
Digital Fundamentals Tenth Edition Floyd Chapter 1 Modified by Yuttapong Jiraraksopakun Floyd, Digital Fundamentals, 10 th 2008 Pearson Education ENE, KMUTT ed 2009 Analog Quantities Most natural quantities
More informationECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010
Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate
More informationComputer Organization and Levels of Abstraction
Computer Organization and Levels of Abstraction Announcements PS8 Due today PS9 Due July 22 Sound Lab tonight bring machines and headphones! Binary Search Today Review of binary floating point notation
More informationDiskrečioji matematika
Diskrečioji matematika www.mif.vu.lt/~algis Basic structures Introduction program euclid (input, output); var x,y: integer; function gcd (u,v: integer): integer; var t: integer; begin repeat if u
More informationComputer Organisation CS303
Computer Organisation CS303 Module Period Assignments 1 Day 1 to Day 6 1. Write a program to evaluate the arithmetic statement: X=(A-B + C * (D * E-F))/G + H*K a. Using a general register computer with
More informationNumbering systems. Dr Abu Arqoub
Numbering systems The decimal numbering system is widely used, because the people Accustomed (معتاد) to use the hand fingers in their counting. But with the development of the computer science another
More informationECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012
Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate
More informationChapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates. Invitation to Computer Science, C++ Version, Third Edition
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition Objectives In this chapter, you will learn about: The binary numbering
More informationCS/COE0447: Computer Organization
CS/COE0447: Computer Organization and Assembly Language Chapter 3 Sangyeun Cho Dept. of Computer Science Five classic components I am like a control tower I am like a pack of file folders I am like a conveyor
More informationCS/COE0447: Computer Organization
Five classic components CS/COE0447: Computer Organization and Assembly Language I am like a control tower I am like a pack of file folders Chapter 3 I am like a conveyor belt + service stations I exchange
More informationComputer Organization
Computer Organization It describes the function and design of the various units of digital computers that store and process information. It also deals with the units of computer that receive information
More informationVIII. DSP Processors. Digital Signal Processing 8 December 24, 2009
Digital Signal Processing 8 December 24, 2009 VIII. DSP Processors 2007 Syllabus: Introduction to programmable DSPs: Multiplier and Multiplier-Accumulator (MAC), Modified bus structures and memory access
More informationComputer Architecture Review. ICS332 - Spring 2016 Operating Systems
Computer Architecture Review ICS332 - Spring 2016 Operating Systems ENIAC (1946) Electronic Numerical Integrator and Calculator Stored-Program Computer (instead of Fixed-Program) Vacuum tubes, punch cards
More informationInf2C - Computer Systems Lecture 2 Data Representation
Inf2C - Computer Systems Lecture 2 Data Representation Boris Grot School of Informatics University of Edinburgh Last lecture Moore s law Types of computer systems Computer components Computer system stack
More informationNumber Systems CHAPTER Positional Number Systems
CHAPTER 2 Number Systems Inside computers, information is encoded as patterns of bits because it is easy to construct electronic circuits that exhibit the two alternative states, 0 and 1. The meaning of
More informationIBM 370 Basic Data Types
IBM 370 Basic Data Types This lecture discusses the basic data types used on the IBM 370, 1. Two s complement binary numbers 2. EBCDIC (Extended Binary Coded Decimal Interchange Code) 3. Zoned Decimal
More informationFinal Labs and Tutors
ICT106 Fundamentals of Computer Systems - Topic 2 REPRESENTATION AND STORAGE OF INFORMATION Reading: Linux Assembly Programming Language, Ch 2.4-2.9 and 3.6-3.8 Final Labs and Tutors Venue and time South
More informationNumeric Encodings Prof. James L. Frankel Harvard University
Numeric Encodings Prof. James L. Frankel Harvard University Version of 10:19 PM 12-Sep-2017 Copyright 2017, 2016 James L. Frankel. All rights reserved. Representation of Positive & Negative Integral and
More informationComputer Organization
Computer Organization KR Chowdhary Professor & Head Email: kr.chowdhary@gmail.com webpage: krchowdhary.com Department of Computer Science and Engineering MBM Engineering College, Jodhpur November 14, 2013
More informationD I G I T A L C I R C U I T S E E
D I G I T A L C I R C U I T S E E Digital Circuits Basic Scope and Introduction This book covers theory solved examples and previous year gate question for following topics: Number system, Boolean algebra,
More informationIntroduction to Computer Science. Homework 1
Introduction to Computer Science Homework. In each circuit below, the rectangles represent the same type of gate. Based on the input and output information given, identify whether the gate involved is
More informationIntroduction to Microcontrollers
Introduction to Microcontrollers Embedded Controller Simply an embedded controller is a controller that is embedded in a greater system. One can define an embedded controller as a controller (or computer)
More information2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS).
2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS). 2.. Natural Binary Code (NBC). The positional code with base 2 (B=2), introduced in Exercise, is used to encode
More informationComputer Systems. Binary Representation. Binary Representation. Logical Computation: Boolean Algebra
Binary Representation Computer Systems Information is represented as a sequence of binary digits: Bits What the actual bits represent depends on the context: Seminar 3 Numerical value (integer, floating
More informationThe LC3's micro-coded controller ("useq") is nothing more than a finite-state machine (FSM). It has these inputs:
midterm exam COSC-120, Computer Hardware Fundamentals, fall 2012 Computer Science Department Georgetown University NAME Open books, open notes (laptops included). Show and explain all your work. Answers
More informationNumber Systems (2.1.1)
Number Systems (2.1.1) Concept of a register. Operations of register, Complementation, Ranges, Left and right shifts, Addition of two binary number, Numerical overflow, 2 s complement representation, Binary
More informationCS 5803 Introduction to High Performance Computer Architecture: Arithmetic Logic Unit. A.R. Hurson 323 CS Building, Missouri S&T
CS 5803 Introduction to High Performance Computer Architecture: Arithmetic Logic Unit A.R. Hurson 323 CS Building, Missouri S&T hurson@mst.edu 1 Outline Motivation Design of a simple ALU How to design
More informationChapter 1 : Introduction
Chapter 1 Introduction 1.1 Introduction A Microprocessor is a multipurpose programmable, clock driven, register based electronic device that reads binary instructions from a storage device called memory,
More informationCS101 Lecture 04: Binary Arithmetic
CS101 Lecture 04: Binary Arithmetic Binary Number Addition Two s complement encoding Briefly: real number representation Aaron Stevens (azs@bu.edu) 25 January 2013 What You ll Learn Today Counting in binary
More informationCHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY COMPUTER ARCHITECURE- III YEAR EEE-6 TH SEMESTER 16 MARKS QUESTION BANK UNIT-1
CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY COMPUTER ARCHITECURE- III YEAR EEE-6 TH SEMESTER 16 MARKS QUESTION BANK UNIT-1 Data representation: (CHAPTER-3) 1. Discuss in brief about Data types, (8marks)
More informationTopic Notes: Bits and Bytes and Numbers
Computer Science 220 Assembly Language & Comp Architecture Siena College Fall 2010 Topic Notes: Bits and Bytes and Numbers Binary Basics At least some of this will be review, but we will go over it for
More informationtime step first instruction second instruction
COMP1200 2001 Semester 1 61 Parallelism Microprocessors can use a variety of tricks to execute more instructions in a given amount of time. One of the most successful is to execute more than one instruction
More informationASSEMBLY LANGUAGE MACHINE ORGANIZATION
ASSEMBLY LANGUAGE MACHINE ORGANIZATION CHAPTER 3 1 Sub-topics The topic will cover: Microprocessor architecture CPU processing methods Pipelining Superscalar RISC Multiprocessing Instruction Cycle Instruction
More informationMemory Addressing, Binary, and Hexadecimal Review
C++ By A EXAMPLE Memory Addressing, Binary, and Hexadecimal Review You do not have to understand the concepts in this appendix to become well-versed in C++. You can master C++, however, only if you spend
More informationCPE300: Digital System Architecture and Design
CPE300: Digital System Architecture and Design Fall 2011 MW 17:30-18:45 CBC C316 Arithmetic Unit 10122011 http://www.egr.unlv.edu/~b1morris/cpe300/ 2 Outline Recap Fixed Point Arithmetic Addition/Subtraction
More informationIntroduction to Computers and Programming. Numeric Values
Introduction to Computers and Programming Prof. I. K. Lundqvist Lecture 5 Reading: B pp. 47-71 Sept 1 003 Numeric Values Storing the value of 5 10 using ASCII: 00110010 00110101 Binary notation: 00000000
More informationChapter 3: Arithmetic for Computers
Chapter 3: Arithmetic for Computers Objectives Signed and Unsigned Numbers Addition and Subtraction Multiplication and Division Floating Point Computer Architecture CS 35101-002 2 The Binary Numbering
More informationCS1100 Introduction to Programming
Course Outline Introduction to Computing CS00 Introduction to Programming Introduction to Computing Programming (in C) Exercises and examples from the mathematical area of Numerical Methods Madhu Mutyam
More information1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM
1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM 1.1 Introduction Given that digital logic and memory devices are based on two electrical states (on and off), it is natural to use a number
More informationChapter 2: Number Systems
Chapter 2: Number Systems Logic circuits are used to generate and transmit 1s and 0s to compute and convey information. This two-valued number system is called binary. As presented earlier, there are many
More informationTopic Notes: Bits and Bytes and Numbers
Computer Science 220 Assembly Language & Comp Architecture Siena College Fall 2011 Topic Notes: Bits and Bytes and Numbers Binary Basics At least some of this will be review for most of you, but we start
More informationChapter 5 12/2/2013. Objectives. Computer Systems Organization. Objectives. Objectives (continued) Introduction. INVITATION TO Computer Science 1
Chapter 5 Computer Systems Organization Objectives In this chapter, you will learn about: The components of a computer system Putting all the pieces together the Von Neumann architecture The future: non-von
More informationProblem Set 1 Solutions
CSE 260 Digital Computers: Organization and Logical Design Jon Turner Problem Set 1 Solutions 1. Give a brief definition of each of the following parts of a computer system: CPU, main memory, floating
More informationCS 101, Mock Computer Architecture
CS 101, Mock Computer Architecture Computer organization and architecture refers to the actual hardware used to construct the computer, and the way that the hardware operates both physically and logically
More informationThe trusted, student-friendly online reference tool. Name: Date:
World Book Online: The trusted, student-friendly online reference tool. World Book Advanced Database* Name: Date: History of Computers Computers! Virtually no other form of technology has become so powerful
More informationCSCI 2021: Binary Floating Point Numbers
CSCI 2021: Binary Floating Point Numbers Chris Kauffman Last Updated: Wed Feb 20 12:16:34 CST 2019 1 Logistics Reading Bryant/O Hallaron Ch 2.4-5 (Floats, now) Ch 3.1-7 (Assembly Intro, soon) 2021 Quick
More informatione-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Introduction to Computing Module No: CS/ES/1 Quadrant 1 e-text
e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Introduction to Computing Module No: CS/ES/1 Quadrant 1 e-text About the course : In this digital world, embedded systems are more
More informationChapter 4: Data Representations
Chapter 4: Data Representations Integer Representations o unsigned o sign-magnitude o one's complement o two's complement o bias o comparison o sign extension o overflow Character Representations Floating
More informationModule 2: Computer Arithmetic
Module 2: Computer Arithmetic 1 B O O K : C O M P U T E R O R G A N I Z A T I O N A N D D E S I G N, 3 E D, D A V I D L. P A T T E R S O N A N D J O H N L. H A N N E S S Y, M O R G A N K A U F M A N N
More informationMicrocontroller Systems
µcontroller systems 1 / 43 Microcontroller Systems Engineering Science 2nd year A2 Lectures Prof David Murray david.murray@eng.ox.ac.uk www.robots.ox.ac.uk/ dwm/courses/2co Michaelmas 2014 µcontroller
More informationBehind the Curtain. Introduce TA Friday 1 st lab! (1:30-3:30) (Do Prelab before) 1 st Problem set on Thurs. Comp 411 Fall /16/13
Behind the Curtain 1. Number representations 2. Computer organization 2. Computer Instructions 3. Memory concepts 4. Where should code go? 5. Computers as systems Introduce TA Friday 1 st lab! (1:30-3:30)
More informationData Representation 1
1 Data Representation Outline Binary Numbers Adding Binary Numbers Negative Integers Other Operations with Binary Numbers Floating Point Numbers Character Representation Image Representation Sound Representation
More informationECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014
Problem 1 (4 parts, 21 points) Encoders and Pass Gates Part A (8 points) Suppose the circuit below has the following input priority: I 1 > I 3 > I 0 > I 2. Complete the truth table by filling in the input
More informationCOMPUTER ORGANIZATION AND ARCHITECTURE
COMPUTER ORGANIZATION AND ARCHITECTURE For COMPUTER SCIENCE COMPUTER ORGANIZATION. SYLLABUS AND ARCHITECTURE Machine instructions and addressing modes, ALU and data-path, CPU control design, Memory interface,
More informationNumber Systems. Readings: , Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs
Number Systems Readings: 3-3.3.3, 3.3.5 Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs Display: Seven segment displays Inputs: Switches Missing: Way to implement
More informationCS6303 COMPUTER ARCHITECTURE LESSION NOTES UNIT II ARITHMETIC OPERATIONS ALU In computing an arithmetic logic unit (ALU) is a digital circuit that performs arithmetic and logical operations. The ALU is
More informationName: CMSC 313 Fall 2001 Computer Organization & Assembly Language Programming Exam 1. Question Points I. /34 II. /30 III.
CMSC 313 Fall 2001 Computer Organization & Assembly Language Programming Exam 1 Name: Question Points I. /34 II. /30 III. /36 TOTAL: /100 Instructions: 1. This is a closed-book, closed-notes exam. 2. You
More informationP( Hit 2nd ) = P( Hit 2nd Miss 1st )P( Miss 1st ) = (1/15)(15/16) = 1/16. P( Hit 3rd ) = (1/14) * P( Miss 2nd and 1st ) = (1/14)(14/15)(15/16) = 1/16
CODING and INFORMATION We need encodings for data. How many questions must be asked to be certain where the ball is. (cases: avg, worst, best) P( Hit 1st ) = 1/16 P( Hit 2nd ) = P( Hit 2nd Miss 1st )P(
More informationCS101 Lecture 25: The Machinery of Computation: Computer Architecture. John Magee 29 July 2013 Some material copyright Jones and Bartlett
CS101 Lecture 25: The Machinery of Computation: Computer Architecture John Magee 29 July 2013 Some material copyright Jones and Bartlett 1 Overview/Questions What did we do last time? Can we relate this
More informationDivide: Paper & Pencil
Divide: Paper & Pencil 1001 Quotient Divisor 1000 1001010 Dividend -1000 10 101 1010 1000 10 Remainder See how big a number can be subtracted, creating quotient bit on each step Binary => 1 * divisor or
More informationOperations On Data CHAPTER 4. (Solutions to Odd-Numbered Problems) Review Questions
CHAPTER 4 Operations On Data (Solutions to Odd-Numbered Problems) Review Questions 1. Arithmetic operations interpret bit patterns as numbers. Logical operations interpret each bit as a logical values
More informationChapter 9: A Closer Look at System Hardware
Chapter 9: A Closer Look at System Hardware CS10001 Computer Literacy Chapter 9: A Closer Look at System Hardware 1 Topics Discussed Digital Data and Switches Manual Electrical Digital Data Representation
More information