Number Theory: Representations of Integers

Similar documents
MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

Conversions between Decimal and Binary

Menu. Review of Number Systems EEL3701 EEL3701. Math. Review of number systems >Binary math >Signed number systems

CISC 1400 Discrete Structures

ENGIN 112 Intro to Electrical and Computer Engineering

Chapter 9 - Number Systems

ECE380 Digital Logic. Positional representation

CS1800 Discrete Structures Final Version A

Counting in Different Number Systems

ENGIN 112 Intro to Electrical and Computer Engineering

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary.

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5)

ENG2410 Digital Design Introduction to Digital Systems. Fall 2017 S. Areibi School of Engineering University of Guelph

CSE 20 DISCRETE MATH. Fall

Informatics 1 - Computation & Logic: Tutorial 3

Week No. 06: Numbering Systems

Playing with Numbers. introduction. numbers in general FOrM. remarks (i) The number ab does not mean a b. (ii) The number abc does not mean a b c.

CSE 241 Digital Systems Spring 2013

12/31/2010. Digital Operations and Computations Course Notes. 01-Number Systems Text: Unit 1. Overview. What is a Digital System?

CHAPTER 2 NUMBER SYSTEMS

Four Important Number Systems

Binary addition example worked out

Design of Digital Circuits Reading: Binary Numbers. Required Reading for Week February 2017 Spring 2017

CSEN102 Introduction to Computer Science

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations.

Number Systems. There are 10 kinds of people those that understand binary, those that don t, and those that expected this joke to be in base 2

CSE 20 DISCRETE MATH. Winter

We say that the base of the decimal number system is ten, represented by the symbol

Computer Number Systems

Students should be able to (a) produce a truth table from a given logic diagram

CPE100: Digital Logic Design I

Discrete mathematics is the study of techniques, ideas and modes of

Section 4.7 Scientific Notation

of Digital Electronics

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System?

Problem Points Score Total 100

NUMBERS AND CODES CHAPTER Numbers

CSCI 255. S i g n e d N u m s / S h i f t i n g / A r i t h m e t i c O p s.

THE LOGIC OF COMPOUND STATEMENTS

1 Computing System 2. 2 Data Representation Number Systems 22

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Number Bases. Ioan Despi. University of New England. August 4, 2013

Digital Systems Roberto Muscedere Images 2013 Pearson Education Inc. 1

NUMBER SYSTEMS. and DATA REPRESENTATION. for COMPUTERS (PROBLEM ANSWERS)

Sail into Summer with Math!

Math 230 Assembly Language Programming (Computer Organization) Numeric Data Lecture 2

MATHEMATICS IN EVERYDAY LIFE 8

hexadecimal-to-decimal conversion

Topic 1: Digital Data

CS1800 Discrete Structures Fall 2017 October, CS1800 Discrete Structures Midterm Version A

ECE260: Fundamentals of Computer Engineering

Chapter 1 :: From Zero to One

Recursive Definitions

Numbers and Arithmetic

Test 2. Monday, November 12, 2018

Base Number Systems. Honors Precalculus Mr. Velazquez

MAT 243 Test 2 SOLUTIONS, FORM A

3 The fundamentals: Algorithms, the integers, and matrices

17.1 Binary Codes Normal numbers we use are in base 10, which are called decimal numbers. Each digit can be 10 possible numbers: 0, 1, 2, 9.

Decimal Addition: Remember to line up the decimals before adding. Bring the decimal straight down in your answer.

CHAPTER 1 NUMBER SYSTEMS. 1.1 Introduction

COT 3100 Applications of Discrete Structures Dr. Michael P. Frank

REVIEW Chapter 1 The Real Number System

0,..., r 1 = digits in radix r number system, that is 0 d i r 1 where m i n 1

CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague 27 October, CS1800 Discrete Structures Midterm Version A

TOPIC 3: READING AND REPORTING NUMERICAL DATA

ABE Math Review Package

What are binary numbers and why do we use them? BINARY NUMBERS. Converting decimal numbers to binary numbers

Please bring the task to your first physics lesson and hand it to the teacher.

6 SQUARES AND SQUARE ROOTS

Discrete Mathematics GCD, LCM, RSA Algorithm

2.5 정수와알고리즘 (Integers and Algorithms)

8.4 Scientific Notation

K K.OA.2 1.OA.2 2.OA.1 3.OA.3 4.OA.3 5.NF.2 6.NS.1 7.NS.3 8.EE.8c

DISCRETE RANDOM VARIABLES EXCEL LAB #3

Base-b representations of integers. (b 진법표현 ) Algorithms for computer arithmetic: Euclidean algorithm for finding GCD s.

Multiplying Products of Prime Powers

ALU (3) - Division Algorithms

Digital Systems Overview. Unit 1 Numbering Systems. Why Digital Systems? Levels of Design Abstraction. Dissecting Decimal Numbers

Why digital? Overview. Number Systems. Binary to Decimal conversion

convert a two s complement number back into a recognizable magnitude.

Accelerated Math. Class work 3. Algebra.

How do computers represent numbers?

Problem Points Score Total 100

Introduction Integers. Discrete Mathematics Andrei Bulatov

Resource: color-coded sets of standards cards (one page for each set)

Counting. Spock's dilemma (Walls and mirrors) call it C(n,k) Rosen, Chapter 5.1, 5.2, 5.3 Walls and Mirrors, Chapter 3 10/11/12

Fundamentals of Digital Design

4 Number Theory and Cryptography

Significant Figure Rules

CHAPTER 7. Exercises 17/ / /2 2 0

Part I, Number Systems. CS131 Mathematics for Computer Scientists II Note 1 INTEGERS

Prepared by Sa diyya Hendrickson. Package Summary

N= {1,2,3,4,5,6,7,8,9,10,11,...}

SAMPLE EXAMINATION PAPER

Intermediate Math Circles February 14, 2018 Contest Prep: Number Theory

ECE 372 Microcontroller Design

Arithmetic Problems. Chapter Reconstruction of division problems AMM E1 This is Problem E1 of the AMERICAN MATHEMATICAL MONTHLY: x x x x

CHAPTER 1 NUMBER SYSTEMS. 1.1 Introduction

Diagnostic Assessment Number and Quantitative Reasoning

Transcription:

Instructions: In-class exercises are meant to introduce you to a new topic and provide some practice with the new topic. Work in a team of up to 4 people to complete this exercise. You can work simultaneously on the problems, or work separate and then check your answers with each other. Turn in one copy of the exercise per group. Names: Number Theory: Representations of Integers Digits For the decimal number 2, 368, we can write this as its individual digits: Thousands (10 3 ) Hundreds (10 2 ) Tens (10 1 ) Ones (10 0 ) 2 3 6 8 And then we can build out 2, 368 as the mathematical equation: 2 10 3 + 3 10 2 + 6 10 1 + 8 10 0 Likewise, for the binary number 0101 1001, we can write it as: And into the equation: 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 0 1 0 1 1 0 0 1 1 2 6 + 1 2 4 + 1 2 3 + 1 2 0 Hexadecimal Digits Hexadecimal numbers go from 0 to 15, but the two-digit numbers (10 through 15) are usually represented with letters so that you can write out a hex number with single characters. A = 10 B = 11 C = 12 D = 13 E = 14 F = 15 1 of 6 By Rachel Singh, last updated October 22, 2018

Question 1 Expand each of the following numbers as a mathematical equation. Make sure to pay attention to the base value. a. Write out the equation for (19) 10 10 1 10 0 b. Write out the equation for (0010 1101) 2 and calculate the decimal equivalent by expanding the equation and calculating the result. 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 c. Write out the equation for (F A6) 16 and calculate the decimal equivalent by expanding the equation and calculating the result. 16 2 16 1 16 0 2 of 6 By Rachel Singh, last updated October 22, 2018

Converting between bases Algorithm for converting a decimal number to base b: 1. Input a natural number n 2. While n > 0, do the following: (a) Divide n by b and get a quotient q and remainder r. (b) Write r as the next (right-to-left) digit. (c) Replace the value of n with q, and repeat. Question 2 Convert the following between bases: a. Convert (35) 10 to binary (base-2) n = 35, b = 2 b. Convert (125) 10 to binary (base-2) n = 125, b = 2 3 of 6 By Rachel Singh, last updated October 22, 2018

Hexadecimal to Binary Often in computers, we write binary strings as hexadecimal to save space and make it easier to read. Hex 0 1 2 3 4 5 6 7 Binary 0000 0001 0010 0011 0100 0101 0110 0111 Hex 8 9 A B C D E F Binary 1000 1001 1010 1011 1100 1101 1110 1111 Example: Convert 11001 from binary to hexadecimal 1. Write out in chunks of four. Add leading 0 s to the left side. 0001 1001 2. Swap out each nibble with hexadecimal 0001 = 1 1001 = 9 So, (0001 1001) 2 = (19) 16 Example: Convert DAD from hexadecimal to binary 1. Convert each digit back to binary. D = 1101 A = 1010 D = 1101 So, (DAD) 16 = (1101 1010 1101) 2 Question 3 Do the following conversions a. Convert (1F 0B) 16 to binary: b. Convert (0100 0110) 2 to hexadecimal: 4 of 6 By Rachel Singh, last updated October 22, 2018

Conversion cheat sheet 1. Converting from base b to base 10: Expand the number in base b to its digit-spaces and create an equation. Example: Convert (121) 3 to base 10 3 2 3 1 3 0 1 2 1 = 1 3 2 + 2 3 1 + 1 3 0 = 9 + 6 + 1 = 16 2. Converting between Binary and Hexadecimal: For converting between base-2 and base-16 (ONLY) you can use this table to swap out 4 bits at a time: Hex 0 1 2 3 4 5 6 7 Binary 0000 0001 0010 0011 0100 0101 0110 0111 Hex 8 9 A B C D E F Binary 1000 1001 1010 1011 1100 1101 1110 1111 Example: Convert (ABC) 16 to binary A = 1010 B = 1011 C = 1100 (ABC) 16 = ( 1010 1011 1100 ) 2 Example: Convert (1111 1010 0010) 2 to hexadecimal 1111 = F 1010 = A 0010 = 2 ( 1111 1010 0010 ) 2 = (F A2) 16 3. Convert decimal to binary: Use the algorithm! 5 of 6 By Rachel Singh, last updated October 22, 2018

Question 4 Convert each of the following using the appropriate methods. a. (10) 10 to base-2. b. (67) 10 to base-2. c. ( 1111 1010 1100 1110 ) 2 to base-16. d. ( 1111 1010 1100 1110 ) 2 to base-10. e. (1EE7) 16 to base-2. f. (1EE7) 16 to base-10. 6 of 6 By Rachel Singh, last updated October 22, 2018