+ CS 325: CS Hardware and Software Organization and Architecture Exam 1: Study Guide.

Slides:



Advertisements
Similar presentations
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and.
Advertisements

Boolean Algebra and Reduction Techniques
Assembly Language and Computer Architecture Using C++ and Java
Assembly Language and Computer Architecture Using C++ and Java
CSC 110 – Intro to Computing Lecture 14: Midterm Review.
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
+ CS 325: CS Hardware and Software Organization and Architecture Integers and Arithmetic Part 4.
Computer ArchitectureFall 2007 © August 29, 2007 Karem Sakallah CS 447 – Computer Architecture.
Computer Programming Skills Revision Prepared by: Ghader Kurdi.
Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University See: P&H Chapter 2.4, 3.2, B.2, B.5, B.6.
Chapter 12 Digital Logic Circuit Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
+ CS 325: CS Hardware and Software Organization and Architecture Integers and Arithmetic.
Boolean Algebra and Logic Simplification
Arithmetic for Computers
CENG 311 Machine Representation/Numbers
Introduction to Digital Logic Design Appendix A of CO&A Dr. Farag
Data Representation – Binary Numbers
Computers Organization & Assembly Language
1 Bits are just bits (no inherent meaning) — conventions define relationship between bits and numbers Binary numbers (base 2)
1 CHAPTER 4: PART I ARITHMETIC FOR COMPUTERS. 2 The MIPS ALU We’ll be working with the MIPS instruction set architecture –similar to other architectures.
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Assembly Language for x86 Processors 7th Edition
1 Modified from  Modified from 1998 Morgan Kaufmann Publishers Chapter Three: Arithmetic for Computers citation and following credit line is included:
COMPUTER SYSTEM ARCHITECTURE By Sohaib.  The digital computer is a digital system that performs various computational tasks.  The word digital implies.
Basic Arithmetic (adding and subtracting)
Fundamentals of IT UNIT-I OnlyforIPMCA. DIGITAL SIGNALS & LOGIC GATES Signals and data are classified as analog or digital. Analog refers to something.
Boolean Algebra and Digital Circuits
Digital Electronics and Computer Interfacing Tim Mewes 3. Digital Electronics.
CSI-2111 Computer Architecture Ipage Revision  Objective : To examine basic concepts of: –2.1 Numbering Systems –2.2 Binary Numbers –2.3 Boolean.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Basic Arithmetic (adding and subtracting)
+ CS 325: CS Hardware and Software Organization and Architecture Integers and Arithmetic Part 2.
1 DLD Lecture 18 Recap. 2 Recap °Number System/Inter-conversion, Complements °Boolean Algebra °More Logic Functions: NAND, NOR, XOR °Minimization with.
CPU Internal memory I/O interface circuit System bus
Numbers and Arithmetic Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University See: P&H Chapter , 3.2, C.5 – C.6.
Operations on Bits Arithmetic Operations Logic Operations
+ CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 2.
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
+ CS 325: CS Hardware and Software Organization and Architecture Gates and Boolean Algebra Part 3.
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
MECH1500 Chapter 3.
1 IKI20210 Pengantar Organisasi Komputer Kuliah No. 23: Aritmatika 18 Desember 2002 Bobby Nazief Johny Moningka
Chapter 1: Binary Systems
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Binary Numbers For digital systems, the.
CSC 331: DIGITAL LOGIC DESIGN COURSE LECTURER: E. Y. BAAGYERE. CONTACT: LECTURE TIME: 15:40 – 17:45 hrs. VENUE: SP-LAB.
ECE 2110: Introduction to Digital Systems
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
ELECTRICAL ENGINEERING: PRINCIPLES AND APPLICATIONS, Third Edition, by Allan R. Hambley, ©2005 Pearson Education, Inc. Chapter 7 Logic Circuits.
9/23/2004Comp 120 Fall September Chapter 4 – Arithmetic and its implementation Assignments 5,6 and 7 posted to the class web page.
EE204 L03-ALUHina Anwar Khan EE204 Computer Architecture Lecture 03- ALU.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
1’S COMPLEMENT REPRESENTATION 1’s complement of a number (binary) is obtained by changing all 1’s to 0 and all 0’s to 1. If one of these numbers is positive.
1 CS 352 Introduction to Logic Design Lecture 1 Ahmed Ezzat Number Systems and Boolean Algebra, Ch-1 + Ch-2.
Unit 1 Introduction Number Systems and Conversion.
CHAPTER 1 : INTRODUCTION
Basic Digital Logic Systems
William Stallings Computer Organization and Architecture 7th Edition
ELL100: INTRODUCTION TO ELECTRICAL ENGG.
Data Representation in Computer Systems
Numbers and Arithmetic
ECEG-3202 Computer Architecture and Organization
Overview Part 1 – Design Procedure Part 2 – Combinational Logic
Logic Circuits I Lecture 3.
ECE 352 Digital System Fundamentals
Laws & Rules of Boolean Algebra
CSE 370 – Winter Number syst.; Logic functions- 1
Presentation transcript:

+ CS 325: CS Hardware and Software Organization and Architecture Exam 1: Study Guide

+ Computer Architecture and Organization Computer Architecture Attributes of the computer that are visible to the programmer. Instruction set Techniques for addressing memory Computer Organization Hardware details transparent to the programmer Control signals Bus interfaces Memory type

+ Basic Structure of Computers

+  CPU – controls the operation of the computer and performs its data processing functions  Main Memory – stores data  I/O – moves data between the computer and its external environment  System Interconnection – some mechanism that provides for communication among CPU, main memory, and I/O There are four main structural components of the computer:

+ Number Systems Number Representation Decimal Binary Hexadecimal Decimal vs. Hexadecimal vs. Binary Number Conversions Dec  Bin, Dec  Hex Bin  Dec, Bin  Hex Hex  Dec, Hex  Bin

+ Decimal Numbers: Base 10 Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Example: 4923 = (4x10 3 ) + (9x10 2 ) + (2x10 1 ) + (3x10 0 )

+ Binary Numbers: Base 2 Digits: 0, 1 Example: = (1x2 5 ) + (0x2 4 ) + (1x2 3 ) + (0x2 2 ) + (1x2 1 ) + (1x2 0 ) = What about a base that converts to binary easily?

+ Hexadecimal Numbers: Base 16 Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Decimal digits + A – F Example: 12E = (1x16 2 ) + (2x16 1 ) + (Ex16 0 ) = ABCDEF

+ Decimal vs. Hexadecimal vs. Binary DECHEXBIN A B C D E F1111 DECHEXBIN A B C D E F

+ Number Conversion: Dec  Bin Converting from base 10 to base 2: Continue dividing decimal number by 2 and keep the remainder Example: /2171LSB 17/281 8/240 4/220 2/210 1/201MSB

+ Number Conversion: Dec  Hex Converting from base 10 to base 16: Example: /1623LSB 2/1602MSB

+ Number Conversion: Bin  Dec Converting from base 2 to base 10: Example: (1x2 4 ) + (1x2 3 ) + (0x2 2 ) + (1x2 1 ) + (0x2 0 ) = MSBLSB

+ Number Conversion: Bin  Hex Converting from base 2 to base 16: Example: Hex digit represents 16 Decimal values 4 Binary digits represent 16 Decimal values 1 Hex digit replaces 4 Binary digits D  D6

+ Number Conversion: Hex  Dec Converting from base 16 to base 10: Example: 8E3 16 (8x16 2 ) + (Ex16 1 ) + (3x16 0 ) =

+ Number Conversion: Hex  Bin Converting from base 16 to base 2: Example: 9A2E MSB A E1110LSB

+ The Transistor A controlled switch. Collector – positive lead Emitter – negative lead Base – control lead A binary “1” represents an active transistor.

+ Representing Signed Numbers 3 ways for handling negative numbers Sign and Magnitude 1’s Complement 2’s Complement

+ Sign and Magnitude Easiest solution: Define leftmost bit to be the sign bit. 0  positive number, 1  negative number Other bits represent numerical value of number 32-bit example:   -1 10

+ Convert Decimal to Sign and Magnitude: S&N requires two things: Sign: 0  positive, 1  negative Magnitude: value to be represented 16-bit Example: bit Example:

+ Convert Sign and Magnitude to Decimal: 8-bit Example: , Another Example: Produces: -0 and +0 problems with this?

+ 1’s Complement 4-bit Example: 1’s comp representation of a 4 bit number 2 n-1 -1 positive numbers 2 n-1 -1 negative numbers PosNeg

+ Converting Decimal to 1’s Comp Example 8-bit: First, convert to Binary 8-bits: Next, compliment the bits:

+ Converting 1’s Comp to Decimal Example 8-bit: MSB is 1 so compliment the bits: Next, convert to Base 10: Since the MSB is 1, the Base 10 value is negative:

+ 2’s Complement Number Line 2 N-1 -1 Pos Nums 2 N-1 Neg Nums 1 zero Must specify width 8-bits, 16-bits, 32-bits Overflow? More on this later

+ 2’s Complement 2 4 bits 2’s CompDecimal

+ Converting Decimal to 2’s Comp Example 8-bit: First, convert to Binary 8-bits: Next, 1s comp: Add 1 to 1s comp value:

+ Converting from 2s Comp to Decimal Algorithm for Converting 2s Comp to Decimal: If the MSB is 1, perform 1s comp and add 1. If the MSB is 0, go to next step. Convert the result to Base 10. This value should be positive. If the MSB was 1, add the negative sign to the Base 10 number.

+ Converting 2’s Comp to Decimal Example 8-bit: MSB is 1 so compliment the bits: And add 1: Since the MSB is 1, the Base 10 value is negative:

+ 2’s Comp Overflow Rules for detecting 2s Comp overflow: If the sum of two Pos numbers yields a Neg result, the sum has overflowed. If the sum of two Neg numbers yields a Pos result, the sum has overflowed. Otherwise, the sum has not overflowed.

+ 2’s Comp Overflow Examples = Carryout without overflow. Sum is correct

+ 2’s Complement Binary Subtraction Example: Subtract 7 from 2 (2 – 7): Convert to 4-bit 2s comp: 7   0010 Perform 2s comp on 7: 0111  1001 Now add: The value 1011 represented in 2’s comp converts to -5 10

+ Unsigned Binary Multiplication Quite Easy. Rules to remember: 0 * 1 = 0 1 * 1 = 1 Same as logical “and” operation Multiplying an m-bit number by and n-bit number results in an n+m-bit number. This n+m-bit width ensures overflow cannot occur. Simple Example: m = n = 2 2x3 = x 11 2 = Largest 2-bit value: 11 or x 11 2 = or 9 10

+ Unsigned Binary Multiplication Example: x ______

+ 2’s Complement Binary Multiplication Still Easy: Only difference between 2’s comp multiply and unsigned multiply: Sign extend both values to twice as many bits. Ex:  x  x The result will be stored in m+n least significant bits.

+ 2’s Complement Binary Multiplication – Booth’s Algorithm Multiplication by bit shifting and addition. Removes the need for multiply circuit Requires: A way to compute 2’s Complement Available as fast hardware instructions X86 assembly instruction: NEG A way to compare two values for equality How to do this quickly? Exclusive Not OR (NXOR) Gate Compare all sequential bits of bit string A and bit string B. Values are equal if the comparison process produces all 1s. A way to shift bit strings. Arithmetic bit shift, which preserves the sign bit when shifting to the right  arithmetic shift right  x86 assembly instruction: SAR ABA NXOR B

+ 2’s Complement Binary Multiplication – Booth’s Algorithm If the LSB of X is 1, and X-1 is 0, we subtract Y from U. If LSB of X is 0, and X-1 is 1, then we add Y to U. If both LSB of X and X-1 are equal, do nothing and skip to shifting stage.

+ 2’s Complement Binary Multiplication – Booth’s Algorithm UVXX-1 0: : : : : Result of 7 x -4: UV  

+ Sign Extension Convert 2’s comp number using N bits to more than N bits (int to long int): Replicate the MSB (sign bit) of the smaller number to fill new bits. 2’s comp positive number has infinite 0s 2’s comp negative number has infinite 1s Ex: 16bit to 32-bit:

+ Combinational Logic Translates a set of N input variables(0 or 1) by a mapping function. Uses Boolean operations to produce a set of M output variables (0 or 1).

+ Boolean Functions

+ Boolean Function from Truth Table ABX

+

+ Digital Logic Sum of Products (SOP) Fan-in, Fan-out Cascading to Reduce Inputs Boolean Algebra Laws Gate Reduction using Boolean Algebra

+ Logic Gate Fan-n and Fan-out

+ Gate Cascading to Reduce Inputs Implementing 3-input AND and OR functions with 2-input gates ABC = (AB)C A+B+C = (A+B)+C Implementing a 3-input NAND function with 2-input gates. NO! Correct

+ Basic Laws of Boolean Algebra Boolean Algebra follows many algebra rules which can be used to make simpler circuits. Example: AB + ACThree gates = A(B + C), Distributive LawTwo gates NameAND FormOR Form Identity Law Null Law Idempotent Law Commutative Law Associative Law Distributive Law Absorption Law De Morgan’s Law

+ Gate Reduction AB + ACThree gates = A(B + C), Distributive LawTwo gates

+ Functionally Complete Sets of Gates Not all gate types are typically implemented in circuit design. Simpler if only 1 or 2 types of gates are used. A functionally complete set of gates means that any Boolean function can be implemented using only the gates in that set. Examples of functionally complete sets: AND, OR, NOT AND, NOT OR, NOT NAND NOR

+ Simplification

+ Checking Logic for Correctness

+ Another Example

+ Converting Boolean Functions to Standard SOP

+

+ Sum-of-Products ABC

+ Product-of-Sums ABC

+ Karnaugh Maps Special form of a given truth table. Useful for reducing logic functions into minimal Boolean expressions. B  A ABX

+ Karnaugh Maps 4-Variables Convert the following 4-variable truth table to its Karnaugh map equivalent: CD  AB ABCDX