CMPS 10 Winter Homework Assignment 5

Similar documents
LSN 2 Number Systems. ECT 224 Digital Computer Fundamentals. Department of Engineering Technology

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic

The string of digits in the binary number system represents the quantity

Computer Science 281 Binary and Hexadecimal Review

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

2011, The McGraw-Hill Companies, Inc. Chapter 3

Binary Adders: Half Adders and Full Adders

Useful Number Systems

Solution for Homework 2

Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8

EE 261 Introduction to Logic Circuits. Module #2 Number Systems

Chapter 1: Digital Systems and Binary Numbers

Gates, Circuits, and Boolean Algebra

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

Unsigned Conversions from Decimal or to Decimal and other Number Systems

CSI 333 Lecture 1 Number Systems

Section 1.4 Place Value Systems of Numeration in Other Bases

Today s topics. Digital Computers. More on binary. Binary Digits (Bits)

Numeral Systems. The number twenty-five can be represented in many ways: Decimal system (base 10): 25 Roman numerals:

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012

Levent EREN A-306 Office Phone: INTRODUCTION TO DIGITAL LOGIC

Chapter 4: Computer Codes

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal.

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

Lecture 8: Synchronous Digital Systems

Positional Numbering System

CHAPTER 3 Boolean Algebra and Digital Logic

Basic Logic Gates Richard E. Haskell

Upon completion of unit 1.1, students will be able to

CS101 Lecture 11: Number Systems and Binary Numbers. Aaron Stevens 14 February 2011

Number Representation

HOMEWORK # 2 SOLUTIO

Lecture 2. Binary and Hexadecimal Numbers

ENGI 241 Experiment 5 Basic Logic Gates

Number and codes in digital systems

BOOLEAN ALGEBRA & LOGIC GATES

Counters and Decoders

COMBINATIONAL CIRCUITS

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Binary Numbers. Binary Octal Hexadecimal

exclusive-or and Binary Adder R eouven Elbaz reouven@uwaterloo.ca Office room: DC3576

Decimal Number (base 10) Binary Number (base 2)

Binary Representation

Chapter 2. Binary Values and Number Systems

Base Conversion written by Cathy Saxton

Boolean Algebra. Boolean Algebra. Boolean Algebra. Boolean Algebra

Sistemas Digitais I LESI - 2º ano

Chapter 1. Computation theory

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal:

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Lecture 4: Binary. CS442: Great Insights in Computer Science Michael L. Littman, Spring I-Before-E, Continued

2 Number Systems. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

Digital Electronics Detailed Outline

2010/9/19. Binary number system. Binary numbers. Outline. Binary to decimal

Circuits and Boolean Expressions

CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions

NUMBER SYSTEMS. William Stallings

The science of computing

Chapter Binary, Octal, Decimal, and Hexadecimal Calculations

Digital Design. Assoc. Prof. Dr. Berna Örs Yalçın

Digital Logic Design. Introduction

Digital System Design Prof. D Roychoudhry Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Bits Superposition Quantum Parallelism

Logic in Computer Science: Logic Gates

Number Systems and Radix Conversion

Lecture 11: Number Systems

3. Convert a number from one number system to another

BINARY CODED DECIMAL: B.C.D.

Binary, Hexadecimal, Octal, and BCD Numbers

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

Systems I: Computer Organization and Architecture

COMPUTER SCIENCE. Paper 1 (THEORY)

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

NUMBER SYSTEMS. 1.1 Introduction

Logic Reference Guide

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

=

SECTION C [short essay] [Not to exceed 120 words, Answer any SIX questions. Each question carries FOUR marks] 6 x 4=24 marks

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:

The New IoT Standard: Any App for Any Device Using Any Data Format. Mike Weiner Product Manager, Omega DevCloud KORE Telematics

Simplifying Logic Circuits with Karnaugh Maps

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

CPEN Digital Logic Design Binary Systems

CSE140: Midterm 1 Solution and Rubric

Prerequisite knowledge Students should have a good understanding of how our decimal number system works as well as understand place value.

Designing Digital Circuits a modern approach. Jonathan Turner

Chapter 3. if 2 a i then location: = i. Page 40

Numbering Systems. InThisAppendix...

Two's Complement Adder/Subtractor Lab L03

Data Storage. 1s and 0s

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Computer Science PLUS I Volume 1 : Concepts Government of Tamilnadu

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

EXPERIMENT 4. Parallel Adders, Subtractors, and Complementors

Transcription:

CMPS 10 Winter 2011- Homework Assignment 5 Problems: Chapter 4 (p.184): 1abc, 3abcd, 4ab, 5abc, 6, 7, 9abcd, 15abcd, 17, 18, 19, 20 1. Given our discussion of positional numbering systems in Section 4.2.1, see whether you can determine the decimal value of the following numbers. a. 133 (base 4) b. 367 (base 8, also called octal). c. 1BA (base 16, also called hexadecimal. B is the digit that represents 11, A is the digit that represents 10). a. (1 x 4 2 ) + (3 x 4 1 ) + (3 x 4 0 ) = 16 + 12 + 3 = 31 Thus, 133 (base 4) = 31 (base 10) b. (3 x 8 2 ) + (6 x 8 1 ) + (7 x 8 0 ) = 192 + 48 + 7 = 247 Thus 367 (base 8) = 247 (base 10) c. (1 x 16 2 ) + (11 x 16 1 ) + (10 x 16 0 ) = 256 + 176 + 10 = 442 Thus 1BA (base 16) = 442 (base 10) 3. Determine the decimal value of the following unsigned binary numbers. a. 1100 c. 1111111 b. 110001 d. 1000000000 a. 2 3 + 2 2 = 8 + 4 = 12 Thus 1100 (base 2) = 12 (base 10) b. 2 5 + 2 4 + 2 0 = 32 + 16 + 1 = 49 Thus 110001 (base 2) = 49 (base 10) c. 2 6 + 2 5 + 2 4 + 2 3 + 2 2 + 2 1 + 2 0 = 64 + 32 + 16 + 8 + 4 + 2 + 1 = 127 Thus 1111111 (base 2) = 127 (base 10) d. 2 9 = 512 Thus 1000000000 (base 2) = 512 (base 10) 4. Using 8 bits, what is the unsigned binary representation of each of the following values: (4 pts) a. 23 b. 55 a. 23 = 16 + 4 + 2 + 1 23 = 2 4 + 2 2 + 2 1 + 2 0 HW 5 Solution 1

Thus 23 (base 10) = 10111 (base 2) b. 55 = 32 + 16 + 4 + 2 + 1 55 = 2 5 + 2 4 + 2 2 + 2 1 + 2 0 Thus 55 (base 10) = 110111 5. Assume that the following 10-bit numbers represent signed integers using sign/magnitude notation. The sign is the leftmost bit and the remaining 9 bits represent the magnitude. What is the decimal value of each? (6 pts) a. 1000110001 c. 1000000001 b. 0110011000 a. -(2 5 + 2 4 + 2 0 ) = -(32 + 16 + 1) = -49 Thus 1000110001 (base 2) = -49 (base 10) b. 2 8 + 2 7 + 2 4 + 2 3 = 256 + 128 + 16 + 8 = 408 Thus 0110011000 (base 2) = 408 (base 10) c. -(2 0 ) = -1 Thus 1000000001 (base 2) = -1 (base 10) 6. Assume we use 10 bits to represent signed integers using sign/magnitude notation. What are the largest (in absolute value) positive and negative numbers that can be represented on our system? The largest positive integer is 0111111111 (base 2), which is 511 (base 10). The smallest negative integer is 1111111111 (base 2), which is -511 (base 10). 7. Show the step-by-step addition of the following two 10-bit unsigned binary values, including showing the carry bit to each successive column. 111 111 0011100011 (decimal 227) +0001101110 (decimal 110) 0101010001 (decimal 337) 9. Using the ASCII code set given in Figure 4.3, s how the internal binary representation for the following character strings. a. AbC c. $25.00 b. Mike d. (a+b) HW 5 Solution 2

To answer this problem, we simply look up the appropriate values in Figure 4.3 (page 141). Spaces are used to break up the individual characters below. a. 01000001 01100010 01000011 b. 01001101 01101001 01101011 01100101 c. 00100100 00110010 00110101 00101110 00110000 00110000 d. 00101000 01100001 00101011 01100010 00101001 15. Assume that a = 1, b = 2, and c = 2. What is the value of each of the following Boolean expressions? (8 pts) a. (a > 1) OR (b = c) b. [(a + b) > c] AND (b c) c. NOT (a = 1) d. NOT [(a = b) OR (b = c)] a. a is not greater than 1, but b does equal c. Therefore, we get: false OR true, which evaluates to: True. b. a + b is greater than c, and b is less than or equal to c. Therefore, we get: true AND true, which evaluates to: True. c. a is equal to 1. Therefore, we get: NOT(true), which evaluates to: False. d. a does not equal b, and b = c. Therefore, we get: NOT(false OR true), which evaluates to: False. 17. Using the circuit construction algorithm of Section 4.4.2, design a circuit using only AND, OR, and NOT gates to implement the following truth table. (2 pts) a b Output 0 0 1 0 1 1 1 0 1 1 1 0 This operation is termed NAND, for Not AND, and it can be constructed as a single gate as shown in Figure 4.17(a). We construct the Boolean expression: HW 5 Solution 3

Using this expression, we can construct the following circuit diagram: Note that there are several variations on this answer in particular, the last two OR gates can be moved around. One OR gate must connect two AND gates (any two), and the other OR gate must connect the first OR gate and the last AND gate. 18. Using the circuit construction algorithm of Section 4.4.2, design a circuit using only AND, ORR, and NOT gates to implement the following truth table. a b Output 0 0 1 0 1 1 1 0 0 1 1 1 This operation is termed logical implication, and it is an important operator in symbolic logic. We construct the Boolean expression: Using this expression, we can construct the following circuit diagram: This solution follows the same guidelines as the last answer the OR gates can be moved around in any order with the AND gates (following the rules from above). 19. Build a majority-rules circuit. This is a circuit that has three inputs and one output. The value of its output is 1 if and only if two or more of its inputs are 1; otherwise the output of the circuit is 0. For example, if the three inputs are 0, 1, 1, your circuit should output a 1. If its three inputs are 0, 1, 0, it should output a 0. This circuit is HW 5 Solution 4

frequently used in fault-tolerant computing environments where a computer must keep working correctly no matter what, for example as on a deep-space vehicle where making repairs is impossible. In these conditions, we might choose to put three computers on board and have all three do every computation; if two ore more of the systems produce the same answer, we accept it. Thus, one of the machines could fail and the system would still work properly. First we must construct a truth table to work from. Using the description above, we can generate the following truth table: a b c Output 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1 From this truth table, we can now construct a Boolean expression: Using this expression, we can then create the following circuit diagram: This circuit diagram can be modified to place any two AND gates with one OR gate, and the other two AND gates with the other OR gate. The final OR gate must take input from the other two OR gates. 20. Design an odd-parity circuit. This is a circuit that has three inputs and one output. The circuit outputs a 1 if and only if an even number (0 or 2) of its inputs are a 1. Otherwise, the circuit outputs a 0. Thus the sum of the number of 1 bits in the input HW 5 Solution 5

and the output is always an odd number. (This circuit is used in error checking. By adding up the number of 1 bits, we can determine whether any single input bit was accidentally changed. If it was, the total number of 1s is an even number when we know it should be an odd value). (2 pts) First we must construct a truth table to work from. Using the rules above, we can generate the following truth table: a b c Output 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 0 From this truth table, we can now construct a Boolean expression: Using this expression, we can then create the following circuit diagram: Like the last problem, this circuit diagram can be modified to place any two AND gates with one OR gate, and the other two AND gates with the other OR gate. The final OR gate must take input from the other two OR gates. HW 5 Solution 6