1 Midterm Exam Review. Data representation 2 For parts a-c: Fill in the missing values of this chart. All binary and hexadecimal values are given in 8-bit.

Slides:



Advertisements
Similar presentations
Digital Design: Combinational Logic Blocks
Advertisements

1 Lecture 4: Procedure Calls Today’s topics:  Procedure calls  Large constants  The compilation process Reminder: Assignment 1 is due on Thursday.
10/9: Lecture Topics Starting a Program Exercise 3.2 from H+P Review of Assembly Language RISC vs. CISC.
The Binary Numbering Systems
2-1 Chapter 2 - Data Representation Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
Chapter 2: Data Representation
Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 2: Data Representation.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 3 Dr. Shi Dept. of Electrical and Computer Engineering.
1 Lecture 3 Bit Operations Floating Point – 32 bits or 64 bits 1.
Storage of Bits Computers represent information as patterns of bits
Chapter 3 Combinational Logic Design
Number System and Codes
Lecture 8 Floating point format
Topic 4 Computer Mathematics and Logic
Lecture 18 Last Lecture Today’s Topic Instruction formats
Simple Data Type Representation and conversion of numbers
Computers Organization & Assembly Language
1 CS/COE0447 Computer Organization & Assembly Language Chapter 3.
Sahar Mosleh PageCalifornia State University San Marcos 1 Multiplexer, Decoder and Circuit Designing.
1 Modified from  Modified from 1998 Morgan Kaufmann Publishers Chapter Three: Arithmetic for Computers citation and following credit line is included:
Dr. Ahmed El-Bialy, Dr. Sahar Fawzy Combinational Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
Review CAS CS210 Ying Ye Boston University. Logical expressions Truth table input: A, B, Coutput: D ABCD (~A)(~B)(~C)
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.
IT253: Computer Organization
Computer Architecture
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles of Computer.
1 A Simple but Realistic Assembly Language for a Course in Computer Organization Eric Larson Moon Ok Kim Seattle University October 25, 2008.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
Data Representation Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
The Teacher CP4 Binary and all that… CP4 Revision.
1 Binary Codes Digital systems use 2-state devices that understand only 2 binary values (0 and 1). But we communicate using various symbols and methods.
Combinational Design, Part 3: Functional Blocks
The Teacher CP4 Binary and all that… CP4 Revision.
CSNB374: Microprocessor Systems Chapter 1: Introduction to Microprocessor.
SAK Chapter 21 Chapter 2 : Number System 2.1 Decimal, Binary, Octal and Hexadecimal Numbers 2.2 Relation between binary number system with other.
CEC 220 Digital Circuit Design Binary Codes
1 Information Representation in Computer Lecture Nine.
Monday, January 14 Homework #1 is posted on the website Homework #1 is posted on the website Due before class, Jan. 16 Due before class, Jan. 16.
Karnaugh Maps (K maps). What are Karnaugh 1 maps?  Karnaugh maps provide an alternative way of simplifying logic circuits.  Instead of using Boolean.
Logic Design CS221 1 st Term combinational circuits Cairo University Faculty of Computers and Information.
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
Number Representation and Arithmetic Circuits
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 4 Dr. Shi Dept. of Electrical and Computer Engineering.
Number Systems and Computer Arithmetic Winter 2014 COMP 1380 Discrete Structures I Computing Science Thompson Rivers University.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
Lecture 6: Floating Point Number Representation Information Representation: Floating Point Number Representation Lecture # 7.
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
1 CS 352 Introduction to Logic Design Lecture 1 Ahmed Ezzat Number Systems and Boolean Algebra, Ch-1 + Ch-2.
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.
Lecture 1 Gunjeet kaur Dronacharya group of institutions.
CS2100 Computer Organisation
Fundamentals of Computer Science
Compsci 210 Tutorial Two CompSci Semester Two 2016.
Lecture No. 4 Number Systems
Introduction To Computer Science
Integer Real Numbers Character Boolean Memory Address CPU Data Types
System Programming and administration
Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables, logic gates,
Number Systems.
CS1010 Programming Methodology
Lecture 4: MIPS Instruction Set
Computer Organization and Design Assembly & Compilation
CMSC250 Fall 2018 Circuits 1 1.
Example 1: (expression evaluation)
Presentation transcript:

1 Midterm Exam Review

Data representation 2 For parts a-c: Fill in the missing values of this chart. All binary and hexadecimal values are given in 8-bit two's complement form. Each row represents the same number in decimal, binary, and hexadecimal. DecimalBinaryHexadecimal a.-37 b c. 0xAB

Data representation: Answer 3 DecimalBinaryHexadecimal a xDB b x1E c xAB

Floating Point Representation 4 What number does the 32-bit IEEE floating point number 0x represent? 529 (sign: 0, exponent: 9, fraction: )

Truth Table 5 Complete the truth table for the contrived circuit below. The circuit has four inputs (w, x, y, z) and two outputs (C, S).

Truth Table: Answer 6 wxyzMUXCS

Short Answer Questions 7 Solve for n: 2 n = 512M 29 Why do memory systems use a shared bus? A shared bus is used because it is too costly and consumes too much space if each memory cell had their own dedicated line. How do circuit designers prevent the shared buses (in memory) from short-circuiting? Short-circuiting is prevented by using tri-state buffers such that at most one memory cell is writing to the shared bus at any given time.

Floating Point Conversion 8 Convert to single precision IEEE floating point format Convert 55 to binary: Convert 0.25 to binary: 0.01 Therefore = Convert to scientific notation: * 2^5 Convert exponent to excess-127: Sign is positive so sign bit = 0 Putting it all together: x425d0000

Multiplexers 9 In class, we used an 8 input multiplexer to implement a three-variable majority function. In this question, we are going to use the same multiplexer for implementing an odd parity function, i.e., the output is 1 if and only if an odd number of inputs are 1. However, for this question, instead of three, you will have four input variables: A, B, C, D. A. Create a truth table for the four variable odd parity function. B. Using the following 8-input multiplexer, implement the Boolean function represented by the truth table in 6A.

Multiplexers: Truth Table 10 AB CD F

Multiplexers: Function Implementation 11

Instruction Set Architecture 12 Following stack based instructions are available to you: Push M Pop M Add Sub Mul Div Using these instructions, write a program to compute: X = (A + B*C)/(D – E*F)

Instruction Set Architecture (Solution) 13 Push A Push B Push C Mul Add Push D Push E Push F Mul Sub Div Pop X

Memory Addresses 14 Given a system with 2^24 Bytes of total memory and fixed partitions, where each partition is 65,536 Bytes. What is the total number of partitions? 2^24/2^16 = 2^8 = 256 How many bits are needed to address each partition uniquely? 8 bits (because 256 = 2^8 )

Linking 15 Following is one possible way of (statically) linking the code: Before scanning the library, the linker builds a list of procedures needed, i.e., the names defined as EXTERN in the modules being linked. Then the linker goes through the library linearly, extracting every procedure that is in the list of names needed. The linker makes only one pass. Does this linking scheme work? If yes, why? If not, why not? How would you fix it?

Linking (Solution) 16 It could fail if a procedure pulled out of the library itself needs another procedure in the library and the needed procedure has already been passed. Possible fixes: 1. Make multiple passes over the library 2. Or, require the library to be sorted so that there are no backward references 3. Or, put an index at the front of the library telling what every procedure needs, so the complete list is known before the scan starts.

ANNA: C++ to ANNA Conversion 17 Convert the C++ statement into ANNA:*p = *p + 1; Assume p is a pointer to a 2-byte integer, is properly initialized, and is located at label p. lli r1 &p lui r1 &p lw r2 r1 0 lw r3 r2 0 addi r3 r3 1 sw r3 r2 0

ANNA: Machine Language Conversion 18 Convert the following instructions from ANNA assembly to ANNA machine language. Specify your answer in hexadecimal notation. lw r1 r2 -3 0x82bd or r5 r4 r2 0x3b10

ANNA: Assembly Language Conversion 19 Convert the following ANNA machine code instructions into ANNA assembly 0x7ca3 lui r6 0xa3 (lui r6 -93 is not correct because the immediate refers to the upper eight bits) 0xcfc1 addi r7 r7 1

Boolean Functions: Dual 20 Which of the following relationships represents the dual of the Boolean property x + x'y = x + y? Choose the best answer. 1. x'(x + y') = x'y' 2. x(x'y) = xy 3. x*x' + y = xy 4. x'(xy') = x'y' 5. x(x' + y) = xy Ans: x(x' + y) = xy

Boolean Functions: Simplification 21 Simplify (A + B)'(C + D + E)' + (A + B)‘ Apply the property x + xy = x, with x = (A + B)'= A'B' and y = (C + D + E)'= C'D'E‘ Ans: A'B‘ Simplify AB + ABC + ABCD + ABCDE + ABCDEF Ans: AB Apply absorption theorem repeatedly: x + xy = x

Besides… 22 Go through all the material in lecture slides Solve all assignment questions Do the recommended readings

23 Thank You!