Chapter (1) Eng. Mai Z. Alyazji

Similar documents
BINARY SYSTEM. Binary system is used in digital systems because it is:

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

CHW 261: Logic Design

Chapter 1. Digital Systems and Binary Numbers

Computer Sc. & IT. Digital Logic. Computer Sciencee & Information Technology. 20 Rank under AIR 100. Postal Correspondence

Digital Fundamentals

Lecture 2: Number Systems

Digital Systems and Binary Numbers

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

MACHINE LEVEL REPRESENTATION OF DATA

CS & IT Conversions. Magnitude 10,000 1,

Korea University of Technology and Education

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

Number System. Introduction. Decimal Numbers

COMP Overview of Tutorial #2

Moodle WILLINGDON COLLEGE SANGLI. ELECTRONICS (B. Sc.-I) Introduction to Number System

Number Systems. Both numbers are positive

COE 202: Digital Logic Design Number Systems Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Digital Fundamentals

Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand

T02 Tutorial Slides for Week 2

Number representations

Chapter 1 Review of Number Systems

Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm. Nathan Pihlstrom.

Chapter 3: Number Systems and Codes. Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc.

Numbering systems. Dr Abu Arqoub

Chapter 2 Binary Values and Number Systems

CS 121 Digital Logic Design. Chapter 1. Teacher Assistant. Hadeel Al-Ateeq

Number Systems. TA: Mamun. References: Lecture notes of Introduction to Information Technologies (ITEC 1011) by Dr Scott MacKenzie

MYcsvtu Notes DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes

in this web service Cambridge University Press

Binary Codes. Dr. Mudathir A. Fagiri

Level ISA3: Information Representation

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Number Systems Base r

COE 202- Digital Logic. Number Systems II. Dr. Abdulaziz Y. Barnawi COE Department KFUPM. January 23, Abdulaziz Barnawi. COE 202 Logic Design

CHAPTER 2 (b) : AND CODES

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr

Lecture (02) Operations on numbering systems

Digital Systems and Binary Numbers

Digital Fundamentals

LOGIC DESIGN. Dr. Mahmoud Abo_elfetouh

Logic and Computer Design Fundamentals. Chapter 1 Digital Computers and Information

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

Electronics Engineering ECE / E & T

Computer Organization

Chapter 5: Computer Arithmetic. In this chapter you will learn about:

UNIT 7A Data Representation: Numbers and Text. Digital Data

Positional Number System

D I G I T A L C I R C U I T S E E

Learning Objectives. Binary over Decimal. In this chapter you will learn about:

MC1601 Computer Organization

Introduction to Numbering Systems

Chapter 1 Emad Felemban

Chapter 2. Positional number systems. 2.1 Signed number representations Signed magnitude

Electronic Data and Instructions

Chapter 2 Bits, Data Types, and Operations

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

Basic Definition INTEGER DATA. Unsigned Binary and Binary-Coded Decimal. BCD: Binary-Coded Decimal

Advanced Computer Architecture-CS501

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700: Digital Logic Design Winter Notes - Unit 4. hundreds.

Binary Addition. Add the binary numbers and and show the equivalent decimal addition.

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-278: Digital Logic Design Fall Notes - Unit 4. hundreds.

Number Systems. Binary Numbers. Appendix. Decimal notation represents numbers as powers of 10, for example

Chapter 1 An Introduction to Computer Science. INVITATION TO Computer Science 1

TOPICS. Other Number Systems. Other Number Systems 9/9/2017. Octal Hexadecimal Number conversion

Chapter 3 DATA REPRESENTATION

Hexadecimal Numbers. Journal: If you were to extend our numbering system to more digits, what digits would you use? Why those?

Octal and Hexadecimal Integers

Integers. N = sum (b i * 2 i ) where b i = 0 or 1. This is called unsigned binary representation. i = 31. i = 0

Objectives. Connecting with Computer Science 2

Decimal & Binary Representation Systems. Decimal & Binary Representation Systems

Number Systems. Dr. Tarek A. Tutunji Philadelphia University, Jordan

Octal & Hexadecimal Number Systems. Digital Electronics

DIGITAL SYSTEM DESIGN

Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:

Chapter 2 Bits, Data Types, and Operations

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

Digital Systems and Binary Numbers

Agenda EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 1: Introduction. Go over the syllabus 3/31/2010

Chapter 10 Binary Arithmetics

Chapter 4 Section 2 Operations on Decimals

Islamic University Gaza Engineering Faculty Department of Computer Engineering ECOM 2125: Assembly Language LAB

ECOM 2325 Computer Organization and Assembly Language. Instructor: Ruba A.Salamah INTRODUCTION

Chapter 5: Computer Arithmetic

World Inside a Computer is Binary

Microcomputers. Outline. Number Systems and Digital Logic Review

Chapter 2 Data Representations

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

NUMBER SENSE AND OPERATIONS. Competency 0001 Understand the structure of numeration systems and multiple representations of numbers.

What Is It? Instruction Register Address Register Data Register

Data Representation 1

Introduction to Computers and Programming. Numeric Values

Numeral Systems. -Numeral System -Positional systems -Decimal -Binary -Octal. Subjects:

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

Kinds Of Data CHAPTER 3 DATA REPRESENTATION. Numbers Are Different! Positional Number Systems. Text. Numbers. Other

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two 26 February 2014

Binary Systems and Codes

Transcription:

THE ISLAMIC UNIVERSITY OF GAZA ENGINEERING FACULTY DEPARTMENT OF COMPUTER ENGINEERING DIGITAL LOGIC DESIGN DISCUSSION ECOM 2012 Chapter (1) Eng. Mai Z. Alyazji September, 2016

1.1 List the octal and hexadecimal numbers from 16 to 32. Using A and B for the last two digits, list the numbers from 8 to 28 in base 12. Decimal 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Octal 20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37 40 Hexadec 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 Decimal 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Base 12 8 9 A B 10 11 12 13 14 15 16 17 18 19 1A 1B 20 21 22 23 24 1.2 What is the exact number of bytes in a system that contains (a) 32K bytes, (b) 64M bytes, and (c) 6.4G bytes? (a) (b) (c) 32 * 2 10 = 32768 bytes 64 * 2 20 = 67108864 bytes 6.4 * 2 30 = 6871947674 bytes 1.3 Convert the following numbers with the indicated bases to decimal: (a) (4310) 5 (b) (198) 12 (c) (435) 8 (d) (345) 6 (a) 4 * 5 3 + 3 * 5 2 + 1 * 5 1 + 0 * 5 0 = (580)10 (b) 1* 12 2 + 9 * 12 1 + 8 * 12 0 = (260)10 (c) 4 * 8 2 + 3 * 8 1 + 5 * 8 0 = (285)10 (d) 3 * 6 2 + 4 * 6 1 + 5 * 6 0 = (137)10 2

1.4 What is the largest binary number that can be expressed with 16 bits? What are the equivalent decimal and hexadecimal numbers? The largest number of any k-digits binary number is that with all digits being 1, such that the largest number of 16-digit binary number is (1111 1111 1111 1111)2 = (65535)10 = (FFFF)16 To calculate the largest number of k bits we can simply use the formula 2 k -1 In this question 2 16-1 = 65536-1=65535 1.5 Determine the base of the numbers in each case for the following operations to be correct: (a) 14/2 = 5 (b) 54/4 = 13 (c) 24 + 17 = 40. (a) (1 * b 1 + 4 * b 0 1 ) / 2 * b 0 1 = 5 * b 0 1 (b + 4) / 2 = 5 b/2 + 4/2 = 5 b = 6 (b) (5 * b 1 + 4 * b 0 1 ) / 4 * b 0 1 = 1 * b 1 + 3 * b 0 1 (5b + 4) / 4 = 1b + 3 5b/4 + 4/4 = 1b + 3 b = 8 (c) (2 *b + 4) + (b + 7) = 4b b = 11 1.6 The solutions to the quadratic equation x 2-11x + 22 = 0 are x = 3 and x = 6. What is the base of the numbers? Notice that the solutions to the equation x 2-11x + 22 in decimal system are 8.37 and 2.62, which means that this equation is in another system, we are asked to get the base of it. 3

(x 3) (x - 6) = x 2 9x + 18 (x 2-11x + 22)b = (x 2 9x + 18)10 (11)b = (9)10 (1 * b 1 + 1 * b 0 1 ) = 9 b = 8 1.7 Convert the hexadecimal number 64CD to binary, and then convert it from binary to octal. (64CD)16 = (0110 0100 1100 1101)2 (110 010011 001 101)2 = (62315)8 1.8 Convert the decimal number 431 to binary in two ways: (a) convert directly to binary; (b) convert first to hexadecimal and then from hexadecimal to binary. Which method is faster? (a) Integer Remainder 431/2 215 1 107 1 53 1 26 1 13 0 6 1 3 0 1 1 0 1 431 = (110101111)2 4

(b) Integer Remainder 431/16 26 F 1 A 0 1 431 = (1AF)16 = (110101111)2 The second method is faster than the first one. 1.9 Convert Express the following numbers in decimal: (a) (10110.0101) 2 (b) (16.5) 16 (c) (26.24) 8 (a) (10110.0101) 2 = 1 * 2 4 + 0 * 2 3 + 1 * 2 2 + 1 * 2 1 + 0 * 2 0 + 0 * 2-1 + 1 * 2-2 + 0 * 2-3 + 1 * 2-4 = 22.3125 (b) (16.5) 16 = 1 * 16 1 + 6 * 16 0 + 5 * 16-1 = 22.3125 (c) (26.24) 8 = 2 * 8 1 + 6 * 8 0 + 2 * 8-1 + 4 * 8-2 = 22.3125 1.10 Convert the following binary numbers to hexadecimal and to decimal: (a) 1.10010, (b) 110.010. Explain why the decimal answer in (b) is 4 times that in (a). (a) 1.100102 = 0001.10012 = 1.916 = 1 + 9/16 = 1.56310 (b) 110.0102 = 0110.01002 = 6.416 = 6 + 4/16 = 6.2510 Reason: 110.0102 is the same as 1.100102 shifted to the left by two places. كل ما بتحرك خانة لجهة اليمين يصبح العدد الجديد ض فع العدد القديم كل ما بتحرك خانة لجهة اليسار يصبح العدد الجديد نصف العدد القديم 5

1.11 Perform the following division in binary: 111011 101. 1011.11 101 111011.00 101 01001 101 1001 101 1000 101 0110 101 001 1.12 Add and multiply the following numbers without converting them to decimal. (a) Binary numbers 1011 and 101. (b) Hexadecimal numbers 2E and 34. a) Addition Multiplication 1 1001 + 0101 1001 0101 1110 1001 00000 100100 101101 6

b) Addition Multiplication 1 2E 2E + 34 34 62 38 + 80 1.13 Do the following conversion problems: (a) Convert decimal 27.315 to binary. B8 2A0 + 600 958 a) Integer Remainder Fraction Integer 27/2 0.315*2 13 1 0.36 0 6 1 0.26 1 3 0 0.52 0 1 1 0.04 1 0 1 0.08 0 0.16 0 0.32 0 27.31510 = 11011.01012 1.14 Obtain the 1 s and 2 s complements of the following binary numbers: (a) 00010000 (b) 00000000 (c) 11011010 (d) 10101010 00010000 00000000 11011010 10101010 1 st complement 11101111 11111111 00100101 01010101 2 nd complement 11110000 00000000 00100110 01010110 7

1.15 Find the 9 s and the 10 s complement of the following decimal numbers: (a) 25,478,036 (b) 63, 325, 600 (c) 25,000,000 (d) 00,000,000. 25478036 63325600 25000000 00000000 9 s complement 74521963 36674399 74999999 99999999 10 s complement 74521964 36674400 75000000 00000000 1.16 (a) Find the 16 s complement of C3DF. (b) Convert C3DF to binary. (c) Find the 2 s complement of the result in (b). (d) Convert the answer in (c) to hexadecimal and compare with the answer in (a). a) FFFF C3DF + 1 = 3C21 b) 1100 0011 1101 1111 c) 0011 1100 0010 0001 d) 3C21 1.17 Perform subtraction on the given unsigned numbers using the 10 s complement of the subtrahend. Where the result should be negative, find its 10 s complement and affix a minus sign. Verify your answers. (a) 4,637-2,579 (b) 125-1,800 a) 10 s complement of 2579 = 9999-2579 + 1 = 7421 4637 + 7421 = 12058 here, the result should be positive; we discard the 1. result = + 2058 b) 10 s complement of 1800 = 8200 8

125 + 8200 = 8325 here, the result should be negative; we find its 10 s complement and affix a minus sign. result= - 1675 1.18 Perform subtraction on the given unsigned binary numbers using the 2 s complement of the subtrahend. Where the result should be negative, find its 2 s complement and affix a minus sign. (a) 10011 10010 (b) 100010 100110 a) 10011 + 01110 = 100001 Result = + 00001, as we discard 1 b) 100010 + 011010 = 111100 Result= - 000100, as the result should be negative. 1.22 Convert decimal 6,514 to both BCD and ASCII codes. For ASCII, an even parity bit is to be appended at the left. 6514 = ( 0110 0101 0001 0100 )BCD = ( 0 0110110 0110101 0110001 0110100)ASCII 1.23 Represent the unsigned decimal numbers 791 and 658 in BCD, and then show the steps necessary to form their sum. 1 1 1 0111 1001 0001 + 0110 0101 1000 1 1 1 1 1 1 1 1101 1110 1001 0110 0110 + = (1449)BCD 0001 0100 0100 1001 9

1

1

1

1