Math Practicum in Information Technology Lesson Plan Performance Objective Upon completion of this lesson, each student will be able to convert between different numbering systems and correctly write mathematical formulas for use in computer programs. Specific Objectives • Students will explain the concept of binary. • Students will convert numbers between binary and decimal. • Students will explain the concept of hexadecimal. • Students will convert numbers between hexadecimal, binary, and decimal. • Students will solve and write equations as utilized in computer programming. This lesson should take 10-12 class days to complete. Preparation TEKS Correlations This lesson, as published, correlates to the following TEKS. Any changes/alterations to the activities may result in the elimination of any or all of the TEKS listed. Practicum in Information Technology 130.280 (c) (3) The student applies academic knowledge and skills to research and develop projects. The student is expected to: (B) demonstrate proper use of mathematics concepts in the development of products or services; and (C) demonstrate proper use of science principles in the development of products or services. Interdisciplinary Correlations Reading I, II, III 110.47(b) (1) The student uses the following word recognition strategies. The student is expected to: (A) Apply knowledge of letter-sound correspondences, language structure, and context to recognize words; Copyright © Texas Education Agency, 2015. All Rights Reserved. 1 (B) Use reference guides such as dictionaries, glossaries, and available technology to determine pronunciations of unfamiliar words; (2) The student acquires an extensive vocabulary through reading and systemic word study. The student is expected to: (A) Expand vocabulary by reading, viewing, listening, and discussing; (B) Determine word meanings through the study of their relationships to other words and concepts such as content, synonyms, antonyms, and analogies; (4) The student comprehends text using effective strategies. The student is expected to: (A) Use prior knowledge and experience to comprehend; (B) Determine and adjust purpose for reading; and (D) Summarize texts by identifying main ideas and relevant details. Public Speaking I, II, III 110.57 (b) (4) Organization. The student organizes speeches. The student is expected to: (B) Organize speeches effectively for specific topics, purposes, audiences, and occasions. (7) Delivery. The student uses appropriate strategies for rehearsing and presenting speeches. The student is expected to: (C) Develop verbal, vocal, and physical skills to enhance presentations. Tasks • Students will utilize provided notes and slide presentation to complete notes pages. • Students will complete worksheets. Accommodations for Learning Differences It is important that lessons accommodate the needs of every learner. These lessons may be modified to accommodate your students with learning differences by referring to the files found on the Special Populations page of this website (cte.unt.edu). Preparation • Copy the handouts. • Have multimedia presentations ready to show the class. Instructional Aids • Student Notes sheet • Student worksheets Materials Needed • Copies • Pencils Copyright © Texas Education Agency, 2015. All Rights Reserved. 2 Equipment Needed • Teacher computer • Projector (for slide presentation) Introduction Learner Preparation • Review slides 1 - 6 of the multimedia presentation with the class (positional numbering systems - specifically decimal). Lesson Introduction • Ask the class: o How is data represented within a computer system? o How would information be more readable or user friendly for programmers and technicians? • Tell the class that every character and command given to a computer by a user is translated into binary before it can be “sent” to the CPU for processing. • Explain that in-depth computer troubleshooting and programming requires a firm understanding of numbering systems and how to convert between them. Copyright © Texas Education Agency, 2015. All Rights Reserved. 3 Outline OUTLINE NOTES TO TEACHER Slides 1 – 6 Decimal Review a. Natural numbers b. Integers c. Positional numbering system d. Number base e. Review of exponent laws regarding 0 and 1st power f. Review positional numbering system a. Hundreds b. Tens c. Ones Slides 8 – 11 Converting from binary to decimal Extension notes are provided in the multimedia presentation. Timeline of delivery is at discretion of instructor. Guidelines regarding division of information are suggestions only. MI Slides 9 – 16 Converting from decimal to binary Slides 17 – 22 Introduction to hexadecimal Conversion from hexadecimal to binary Slides 23 – 26 Conversion from decimal to hexadecimal Slides 27 – 31 Rewriting math in programming Slides 32 – 36 Using math in programming Upon completion of Slide 11, give students the binary to decimal conversion worksheet. Upon completion of Slide 16, give students the decimal to binary worksheet. Upon completion of Slide 22, give students the hexadecimal to binary worksheet. Upon completion of Slide 26, give students the decimal to hexadecimal worksheet. Upon completion of Slide 31, give students the evaluation of expressions worksheet. Upon completion of Slide 36, give students the worksheet on using programs to write and solve mathematical formulas worksheet. Multiple Intelligences Guide Existentialist Interpersonal Intrapersonal Kinesthetic/ Bodily Logical/ Mathematical Musical/Rhythmic Naturalist Verbal/Linguistic Copyright © Texas Education Agency, 2015. All Rights Reserved. Visual/Spatial 4 Application Guided Practice Students will use the provided slide presentation to complete the notes handouts pages. Independent Practice • Students will complete all provided worksheets: o Binary to decimal o Decimal to binary o Hexadecimal to binary o Decimal to hexadecimal o Rewriting math for computer programs o Using math in computer programs Summary Review • Why is it important to know how to use math properly? • What is the fundamental language of computers? • Why was binary chosen as machine language? Evaluation Informal Evaluation • The teacher will check frequently for understanding • Very small work group option (peer tutoring) Formal Evaluation • Worksheets and test over the material Copyright © Texas Education Agency, 2015. All Rights Reserved. 5 Binary, Hex, and Decimal, “Oh My”! Student Notes Handout a. numbers a. Zero and any number obtained by repeatedly adding one to it b. Ex. 0, 1, 3, 100 b. Integers a. Any number b. Includes negative numbers and zero c. Numbering System a. The number depends on the position of the digits to represent the number. d. Number base a. The (or radix) is the number of digits used to represent numbers in a positional numerical system. Any number to the power is equal to 1. 0 Example: 2 = Any number to the power is equal to that 1 Example: 2 = 2 . Copyright © Texas Education Agency, 2015. All Rights Reserved. 6 Converting from Decimal to Binary • Base • The base of a number is indicated by a value at the “end” of the number. If there is no subscript the base is assumed to be 10 (or decimal). • Uses and • Binary uses two as its base so each is equal to two to an exponent. • Since we are using two single characters we use and as our two digits. • Consider the binary number 000011102. Binary Table Do you see how each in value? This makes binary one of the easiest numbering systems to convert to decimal. Using basic addition, we can take any binary number and convert it to a decimal equivalent. As long as you memorize the pattern all you have to do is the value of the placeholders where a 1 appears. Copyright © Texas Education Agency, 2015. All Rights Reserved. 7 Look at the table. In the top row you notice there are only zeros and ones. This one is a little easier for you by adding the table and colors. This is the number we are going to convert to decimal, . By looking down the chart you can see that we are going to use the following values: , , and because there are 1s in those placeholders. Note that red indicates which numbers we will use to convert to a decimal value. Using the formal method, we would transfer the digits to the blue box you see on the right of the slide. I like to use the vertical alignment to make things easier to read. We start with ; determine that there is a zero in that placeholder. What is the answer when you multiply any number by zero? Answer: Moving down the line we have zeros until we get to the place holder right? This placeholder has a ________ instead of a zero. , which is equal to What is the product of any number multiplied by one? Answer: number Once you have calculated the appears, we add the answers together. What is the sum of 8+4+2? Answer: The decimal equivalent of of all the placeholders where a 1 is , which is shown in the green box. Copyright © Texas Education Agency, 2015. All Rights Reserved. 8 Converting from Decimal to Binary • Can be done two different ways – – Long Division Convert from decimal to binary. Sort by the original number by our base, which is . Notice that we do not directly divide 35 by 2 and get 16. You must divide the numbers so that you have a of or at the end of the process. Once you reach a 0 or 1 as the remainder you move to the next step. Using the we got in the first step (35 divided by 2), we move to the second step, which is dividing by 2. We the process until we have in the , , and . Now here comes the tricky part. Example: 1 2 3 2 1 5 8 2 1 1 4 2 8 8 2 2 4 4 0 0 1 2 2 2 1 2 0 0 0 2 Binary Each of the zeros and ones in the remainders represent individual . These bits are in order so we have to do what we call “ ,“ meaning we rewrite them putting the bit in the position when we write the number in binary format. is flipped to . Once we rewrite the number, we see that 35 in binary is 01000112 . You can always check your answer by using the binary to decimal conversion method. Go ahead, check our math. = Copyright © Texas Education Agency, 2015. All Rights Reserved. 9 Subtraction Convert 3710 to binary using subtraction Looking at our binary table what is the ? Answer: number that is still less than To indicate that 32 will be used, we put a in the from 37 we have left, right? What is the lower than 3? Answer: placeholder. Once we subtract 32 number in our table that is still Skip down to the placeholder and put in a 1. What is the only number left that we can use that is lower than or equal to 1? Answer: Now we put a in the placeholder. Continue the subtraction process until we get zero as an answer. What do you think we do with all those blank spaces in the table? Answer: Unlike using the division method, you the binary representation of = have to “flip the bits” in this case, so . Copyright © Texas Education Agency, 2015. All Rights Reserved. 10 Hexadecimal Characters – – – – You can convert directly from hex to decimal but not from decimal to hex. In order to represent the numbers – A = 10, B = 11, C = 12, D = 13, E = 14, and F = 15. (to give us our 16 characters) we use letters. Each is equal to (combination of zeros and ones), and like binary, can be combined to create even larger numbers. Hexadecimal (Hex) Binary Decimal 0001 1 2 3 2 0011 0100 5 6 5 0110 0111 8 9 1001 B 1100 E As with binary and decimal, system. Each placeholder uses 10 11 1101 F 7 8 1010 C 4 13 14 1111 is a numbering as its base and is equal to 16 to an exponent. Copyright © Texas Education Agency, 2015. All Rights Reserved. 11 Look at the table. is the hexadecimal number we are going to convert to decimal. By looking at the chart, I can see that we are going to use the following values: and because there are characters in those placeholders. Note that the color red indicates which numbers we will use to convert to a value. Using the formal method again and for easier reading, we will we use to the blue box on the right of the slide. Just like converting binary, once you have calculated the where a character appears, we the answers together. What is the sum of 240 + 15? Answer: The decimal equivalent of is the of all the placeholders ,which is shown in the green box. Copyright © Texas Education Agency, 2015. All Rights Reserved. 12 Decimal to Hex Conversion Convert 5410 to Hexadecimal The easiest way to convert a decimal number to hex is to go to at it using the subtraction method to go from decimal to binary. first. Let’s look Convert from to binary Convert from binary to Now we know that is equal to in binary. Here is where we take the next step. Remember that when we first discussed hexadecimal and looked at the hex/binary/decimal table you learned that each hex character represents binary bits. Note that we have of the four bits are then the binary bits into into a Looking first at the left-hand group of four: hex? Answer: Look at the second group of four: Answer: of . Each character. . How would is that number represented in . How would you represent that number in hex? While it looks like 5410 in hex is thirty-six ,it is actually read as Copyright © Texas Education Agency, 2015. All Rights Reserved. . 13 Convert 12810 to Hexadecimal Decimal to binary Binary to hex Rewriting math in Programming • – Parentheses – – Multiplication and/or division in the order they appear – Addition and/or subtraction in the Writing Formulas for Computer Programs What is the formula in the green box? Answer: Area of a circle Computer programs do not recognize the symbol for Pi and there are no options for superscripts to indicate exponents in the majority of compilers. This very common formula must be rewritten in a way a computer program can decipher it. Copyright © Texas Education Agency, 2015. All Rights Reserved. 14 In order to represent exponents, we use what’s called a “carrot top,” which you see in the red box and you get by pressing . To represent you must use the value . For most applications 3.14 is adequate; however, for more precise calculations, you can use as many decimal places as you require. You can use virtually any variable to represent the A; however, you must remember that certain words are “ “ and can vary from language to language, so be cautious and document your code so that other programmers will be able to understand your code easily. Looking at the blue box, we see how the same formula would be written in a computer program. Notice we have used the “ top” to indicate the and the number 3.14 to represent . r has been left alone with the assumption that the radius is either in or by the user at some earlier point in the program. Rewrite the formula for the slope of a line Using Math in Computer Programming Math is universal. The of programs that are written involve some type of . The formulas can range from very simple to highly complex. • Used to – Solve and or complex calculations • for a company • Track data sets in calculations – Create files (programs) – Create systems • Machine Language Everything that happens within a computer all the way from the GUI we see to the files we save is into language. Each entered into the machine; each the user issues is translated into codes. Boolean Operators Because of some of the programs you will write, we also need to discuss the or Boolean operators in computer programming. These operators have their own , fit into , and have a specific of operation. Copyright © Texas Education Agency, 2015. All Rights Reserved. 15 Boolean/Logic (or bool) Operators a. Also called Operators or just b. Logical operators that or a. = false b. = true c. Three basic bool operators a. = – arguments must be true for the statement to return True. b. = – argument may be for the statement to return True. c. = – the statement to if it returns and if it returns . d. Order of operations – as with PEMDAS , groups are evaluated and operators are evaluated in the following order: a. b. c. d. e. f. g. Copyright © Texas Education Agency, 2015. All Rights Reserved. 16 Truth Tables These are truth tables. tables help us to visualize all possible results of or comparisons. The results of AND and NOTAND are in the blue tables while the results of OR and NOTOR are in the green tables. Truth tables help us step through our program code and determine if our Copyright © Texas Education Agency, 2015. All Rights Reserved. is sound. 17 Binary, Hex, and Decimal Oh My Student Notes Handout a. Natural numbers a. Zero and any number obtained by repeatedly adding one to it b. Ex. 0, 1, 3, 100 b. Integers a. Any whole number b. Includes negative numbers and zero c. Positional Numbering System a. The number depends on the position of the digits to represent the number. d. Number base a. The base (or radix) is the number of single digits used to represent numbers in a positional numerical system. Any number to the 0 power is equal to 1. Example: 20 = 1 Any number to the 1st power is equal to that number. Example: 21 = 2 2 7 * 10 = 7 * 100 = 700 1 2 * 10 = 4 * 10 = + 20 0 5 * 10 = 5 * 1 = + 5 725 Copyright © Texas Education Agency, 2015. All Rights Reserved. 18 Converting from Decimal to Binary • • • • • • Base 2 The base of a number is indicated by a subscript value at the “end” of the number. If there is no subscript the base is assumed to be 10 (or decimal). Uses 0 and 1 Binary uses two as its base so each placeholder is equal to two to an exponent. Since we are using two single characters we use zero and one as our two digits. Consider the binary number 000011102. This is where binary digits (0s and 1s) go Do you see how each placeholder doubles in value? This makes binary one of the easiest numbering systems to convert to decimal. Using basic addition, we can take any binary number and convert it to a decimal equivalent. As long as you memorize the pattern all you have to do is add the value of the placeholders where a 1 appears. Copyright © Texas Education Agency, 2015. All Rights Reserved. 19 Convert 00011102 from binary to decimal Look at the table. In the top row you notice there are only have zeros and ones. This one is a little easier for you by adding the table and colors. This is the binary number we are going to convert to decimal, 00001110. By looking down the chart you can see that we are going to use the following values: 23, 22, and 21 because there are 1s in those placeholders. Note that red indicates which numbers we will use to convert to a decimal value. Using the formal method, we would transfer the digits to the blue box you see on the right of the slide. The vertical alignment makes things easier to read. I like to use the vertical alignment to make things easier to read. We start with 128; determine that there is a zero in that placeholder. What is the answer when you multiply any number by zero? Answer: zero 3 Moving down the line we have zeros until we get to the place holder 2 , which is equal to 8 right? This placeholder has a one instead of a zero. What is the product of any number multiplied by one? Answer: That number Once you have calculated the products of all the placeholders where a 1 appears, we add the answers together. What is the sum of 8+4+2? Answer: 14 The decimal equivalent of 000011102 is 14, which is shown in the green box. Converting from Decimal to Binary • Can be done two different ways Copyright © Texas Education Agency, 2015. All Rights Reserved. 20 – Long division – Subtraction Long Division Convert 3510 from decimal to binary. Start by dividing the original number by our base, which is 2. Notice that we do not directly divide 25 by 2 and get 16. You must divide the numbers individually so that you have a remainder of zero or one at the end of the process. Once you reach a 0 or 1 as the remainder you move to the next step. Using the quotient we got in the first step (35 divided by 2), we move to the second step, which is dividing 17 by 2. We repeat the process until we have zero in the quotient, dividend, and remainder. Now here comes the tricky part. Example: 1 2 3 2 1 5 1 8 2 1 1 4 2 8 8 2 2 4 4 1 0 0 0 0 1 2 2 2 1 2 0 0 0 2 0 1 Binary 0 Each of the zeros and ones in the remainders represent individual bits. These bits are in reverse order so we have to do what we call “flipping the bits,” meaning we rewrite them putting the rightmost bit in the leftmost position when we write the number in binary format. 1100010 is flipped to 0100011. Once we rewrite the number we see that 35 in binary is 01000112 . You can always check your answer by using the binary to decimal conversion method. Go ahead, check our math. 0100011 = 35 Copyright © Texas Education Agency, 2015. All Rights Reserved. 21 Subtraction Convert 3710 to binary using subtraction Looking at our binary table what is the highest number that is still less than 37? Answer: 32 To indicate that 32 will be used, we put a 1 in the 25 placeholder. Once we subtract 32 from 37 we have 3 left, right? What is the highest number in our table that is still lower than 3? Answer: 2 1 Skip down to the 2 placeholder and put in a 1. What is the only number left that we can use that is lower than or equal to 1? Answer: 1 0 Now we put a 1 in the 2 placeholder. Continue the subtraction process until we get zero as an answer. What do you think we do with all those blank spaces in the table? Answer: Fill them with zeros because they are not used. Unlike using the division method, you do not have to “flip the bits” in this case, so the binary representation of 3710 = 001000112. Copyright © Texas Education Agency, 2015. All Rights Reserved. 22 Hexadecimal Characters – 0–9 – A–F You can convert directly from hex to decimal but not from decimal to hex. In order to represent the numbers 10 – 15 (to give us our 16 characters) we use letters. A = 10, B = 11, C = 12, D = 13, E = 14, and F = 15. Each character is equal to four bits (combination of zeros and ones), and like binary, can be combined to create even larger numbers. Hexadecimal (Hex) Binary Decimal 1 0001 1 2 0010 2 3 0011 3 4 0100 4 5 0101 5 6 0110 6 7 0111 7 8 1000 8 9 1001 9 A 1010 10 B 1011 11 C 1100 12 D 1101 13 E 1110 14 F 1111 15 As with binary and decimal, hexadecimal is a positional numbering system. Each placeholder uses 16 as its base and is equal to 16 to an exponent. Copyright © Texas Education Agency, 2015. All Rights Reserved. 23 Look at the table. FF is the hexadecimal number we are going to convert to decimal. 1 0 By looking down the chart, I can see that we are going to use the following values: 16 and 16 because there are characters in those placeholders. Note that I have used the color red to indicate which numbers we will use to convert to a decimal value. Using the formal method again and for easier reading, we will transfer the digits we use to the blue box on the right of the slide. Just like converting binary, once you have calculated the products of all the placeholders where a character appears, we add the answers together. What is the sum of 240 + 15? Answer: 255 The decimal equivalent of FF16 is 255, which is shown in the green box. Copyright © Texas Education Agency, 2015. All Rights Reserved. 24 Decimal to Hex Conversion Convert 5410 to Hexadecimal The easiest way to convert a decimal number to hex is to go to binary first. Let’s look at it using the subtraction method to go from decimal to binary. Convert from decimal to Convert from binary to hex Now we know that 5410 is equal to 00110110 in binary. Here is where we take the next step. Remember that when we first discussed hexadecimal and when we looked at the hex/binary/ decimal table you learned that each hex character represents four binary bits. Note that we have divided the binary bits into groups of four. Each of the four bits are then translated into a hex character. Looking first at the left-hand group of four: 0011. How would you represent that number in hex? Answer: 3 Look at the second group of four: 0110. How would you represent that number in hex? Answer: 6 While it looks like 5410 in hex is thirty-six, it is actually read as “three six.” Copyright © Texas Education Agency, 2015. All Rights Reserved. 25 Convert 12810 to Hexadecimal Rewriting math in Programming • PEMDAS – Parentheses – Exponents – Multiplication and/or division in the order they appear – Addition and/or subtraction in the order they appear Writing Formulas for Computer Programs What is the formula in the green box? Answer: Area of a circle Copyright © Texas Education Agency, 2015. All Rights Reserved. 26 Computer programs do not recognize the symbol for Pi and there are no options for superscripts to indicate exponents in the majority of compilers. This very common formula must be rewritten in a way a computer program can decipher it. In order to represent exponents, we use what’s called a “carrot top,” which you see in the red box and you get by pressing shift+6. To represent Pi you must use the numerical value 3.14. For most applications 3.14 is adequate; however, for more precise calculations, you can use as many decimal places as you require. You can use virtually any variable to represent the A; however, you must remember that certain words are “reserved words” and can vary from language to language, so be cautious and document your code so that other programmers will be able to understand your code easily. Looking at the blue box we see the way we would write the same formula in a computer program. Notice we have used the “carrot top” for the exponent and the number 3.14 to represent Pi. r has been left alone with the assumption that the radius is either read in or entered by the user at some earlier point in the program. Rewrite the formula for the slope of a line Using Math in Computer Programming Math is universal. The majority of programs that are written involve some type of calculation. The formulas can range from very simple to highly complex. • Used to – Solve repetitive and or complex calculations • Payroll for a company • Track complex data sets in scientific calculations – Create executable files (programs) – Create automated systems • Machine Language Everything that happens within a computer all the way from the GUI we see to the files we save is translated into machine language. Each character entered into the machine; each instruction the user issues is translated into binary codes. Copyright © Texas Education Agency, 2015. All Rights Reserved. 27 Boolean Operators Because of some of the programs you will write, we also need to discuss the logical or Boolean operators in computer programming. These operators have their own symbols, fit into PEMDAS, and have a specific order of operations. Boolean/Logic (or bool) Operators a. Also called Logical Operators or just bool b. Logical operators that return true or false a. 0 = false b. 1 = true c. Three basic bool operators a. and = and - AND: both arguments must be true for the statement to return True. b. || - OR: either argument may be true for the statement to return True. c. ! – NOT: toggles the statement to False if it returns True and True if it returns False. d. Order of operations – As with PEMDAS, parenthetical groups are evaluated first and operators are evaluated in the following order: a. NOT (!) b. Multiplication/division (*, /) c. Addition/subtraction (+, -) d. Relational operators (<, <=, >, >=) e. NOT Equal (!=) f. AND (andand) g. OR (||) Copyright © Texas Education Agency, 2015. All Rights Reserved. 28 Truth Tables These are truth tables. Truth tables help us to visualize all possible results of Boolean or logical comparisons. The results of AND and NOTAND are in the blue tables while the results of OR and NOTOR are in the green tables. Truth tables help us step through our program code and determine if our logic is sound and rational. Copyright © Texas Education Agency, 2015. All Rights Reserved. 29 Binary to Decimal Worksheet Convert the following numbers from binary to decimal. Please show your work. Do not use electronic devices. a. 10101001 b. 00110010 c. 00111100 d. 11101100 e. 00001000 f. 00101000 g. 00011000 h. 10011001 i. 11111111 j. 01100000 Copyright © Texas Education Agency, 2015. All Rights Reserved. 30 Binary to Decimal Worksheet KEY Convert the following numbers from binary to decimal. Please show your work. Do not use electronic devices. 1. 10101001 - 169 2. 00110010 - 50 3. 00100100 - 36 4. 11101100 - 236 5. 00001000 - 8 6. 01001000 - 72 7. 00011000 - 24 8. 10011001 - 153 9. 11111111 - 255 10. 01100000 - 69 Copyright © Texas Education Agency, 2015. All Rights Reserved. 31 Decimal to Binary Worksheet Convert the following decimal numbers to binary. For the first five you may use the subtraction method. For the second five you must use the long division method. You must show all work. No electronic devices are allowed. Please use a separate sheet of paper. 1. 192 2. 168 3. 253 4. 169 5. 17 6. 25 7. 173 8. 127 9. 5 10. 39 Copyright © Texas Education Agency, 2015. All Rights Reserved. 32 Decimal to Binary Worksheet KEY Convert the following decimal numbers to binary. For the first five you may use the subtraction method. For the second five you must use the long division method. You must show all work. No electronic devices are allowed. Please use a separate sheet of paper. 1. 192 = 11000000 2. 168 = 10100100 3. 253 = 11111101 4. 169 = 10101001 5. 17 = 00010001 6. 25 = 00011001 7. 173 = 10101101 8. 127 = 01111111 9. 5 = 00001001 10. 39 = 00100111 Copyright © Texas Education Agency, 2015. All Rights Reserved. 33 Hexadecimal to Decimal Conversion You will need to convert the numbers below from hexadecimal to decimal format. Please do not use a calculator (or any other electronic device) and show all work. 1. 0216 2. 3016 3. 1016 4. 0F16 5. F016 6. E116 7. 8016 8. AB16 9. C116 10. 0D16 Copyright © Texas Education Agency, 2015. All Rights Reserved. 34 Hexadecimal to Decimal Conversion KEY You will need to convert the numbers below from hexadecimal to decimal format. Please do not use a calculator (or any other electronic device) and show all work. 1. 0216 = 2 2. 3016 = 48 3. 1016 = 16 4. 0F16 = 15 5. F016 = 240 6. E116 = 225 7. 8016 = 128 8. AB16 = 171 9. C116 = 193 10. 0D16 = 13 Copyright © Texas Education Agency, 2015. All Rights Reserved. 35 Binary to Hexadecimal Conversions Convert the following numbers from binary to hexadecimal. Please show your work. Do not use electronic devices. 1. 10101001 2. 00110010 3. 00111100 4. 11101100 5. 00001000 6. 00101000 7. 00011000 8. 10011001 9. 11111111 10. 01100000 Copyright © Texas Education Agency, 2015. All Rights Reserved. 36 Binary to Hexadecimal Conversions KEY Convert the following numbers from binary to hexadecimal. Please show your work. Do not use electronic devices. 1. 10101001 = A916 2. 00110010 = 3216 3. 00111100 = 3C16 4. 11101100 = EC16 5. 00001000 = 0816 6. 00101000 = 2916 7. 00011000 = 1816 8. 10011001 = 9916 9. 11111111 = FF16 10. 01100000 = 6016 Copyright © Texas Education Agency, 2015. All Rights Reserved. 37 Decimal to Hexadecimal Conversions Convert the numbers below from decimal to hexadecimal. Please show all your work and do not use electronic devices. 1. 255 2. 33 3. 26 4. 51 5. 169 6. 172 7. 89 8. 64 9. 22 10. 47 Copyright © Texas Education Agency, 2015. All Rights Reserved. 38 Decimal to Hexadecimal Conversions KEY Convert the numbers below from decimal to hexadecimal. Please show all your work and do not use electronic devices. 1. 255 = FF16 2. 33 = 2116 3. 26 = 1A16 4. 51 = 3316 5. 169 = A916 6. 172 = AC16 7. 89 = 5916 8. 64 = 4016 9. 22 = 1616 10. 47 = 2F16 Copyright © Texas Education Agency, 2015. All Rights Reserved. 39 Evaluations of Expressions and Formulas Evaluate the following expressions as the computer does. Show your work NEATLY and include all calculations. Round your final answer to ONE decimal place. 1. 28 – 2 * 6 + 4 – 2 * 12 / 4 + 3^2 3. 8 * (4 – 6 / 3) – (5 – 6 * 4 / 3) 5. 9 * 6 / 5 * 2 + 4 – 4 ^2 + 9 / 4 – (-6) / 2 2. 7.3 – 4.2 + 1.2^ 2 / (-0.6) 4. (4.3 – 2.5) / (7 + 2.1 / 0.7 – 1) -2 * (4.5 / 2) 6. 35 / (6 / 3 + 2^3) / (6 – 2 – 5) Write the following formulas in the correct form to be used in a BASIC expression. Alphabetic characters represent variables. Special symbols should be written numerically. 7. V = πh (r2 + rA + A2) 3 8. V = P 1 – (1 + i) –n i 9. A = P 1 + r m 10. C = (x – h)2 + (y – k)2 3a2 4b mt Copyright © Texas Education Agency, 2015. All Rights Reserved. 40 Evaluations of Expressions and Formulas KEY Evaluate the following expressions as the computer does. Show your work NEATLY and include all calculations. Round your final answer to ONE decimal place. 1. 28 – 2 * 6 + 4 – 2 * 12 / 4 + 3^2 2. 7.3 – 4.2 + 1.2^ 2 / (-0.6) 28 – 2 * 6 + 4 – 2 * 12 / 4 + 9 7.3 – 4.2 + 1.44 / (-0.6) 28 – 12 + 4 – 24 / 4 + 9 7.3 – 4.2 + (-2.4) 28 – 12 + 4 – 6 + 9 0.7 23 3. 8 * (4 – 6 / 3) – (5 – 6 * 4 / 3) 8 * (4 – 2) – (5 – 24 / 3) 8 * (4 – 2) – (5 – 8) 8 * 2 – (-3) 16 – (-3) 19 4. (4.3 – 2.5) / (7 + 2.1 / 0.7 – 1) -2 * (4.5 / 2) (1.5) / (7 + 3 – 1) – 2 * 2.25 1.5 / 9 – 4.5 .166 – 4.5 -4.3 5. 9 * 6 / 5 * 2 + 4 – 4 ^2 + 9 / 4 – (-6) / 2 9 * 6 / 5 * 2 + 4 – 16 + 9 / 4 – (-6) / 2 54 / 5 * 2 + 4 – 16 + 9 / 4 – (-6) / 2 21.6 + 4 – 16 + 2.25 – (-3) 16.9 6. 35 / (6 / 3 + 2^3) / (6 – 2 – 5) 35 / (6 / 3 + 8) / (6 – 2 – 5) 35 / (2 + 8) / (-1) 35 / 10 / (-1) -3.5 Write the following formulas in the correct form to be used in a BASIC expression. Alphabetic characters represent variables. Special symbols should be written numerically. 7. V = πh (r2 + rA + A2) 8. V = P 1 – (1 + i) –n 3 i V = (3.14 * h * (r^2 + r * A + A^2)) / 3 V = P * (1 – ((1 + i) ^ -n) / i) 9. A = P 1 + r mt m A = P * ((1 + r / m) ^ (m * t)) 10. C = (x – h)2 + (y – k)2 3a2 4b C = ((x – h)^2) / (3 * a^2) + ((y – k) ^2) / (4 * b) Copyright © Texas Education Agency, 2015. All Rights Reserved. 41 Numbering Conversions Test Convert the following from binary to decimal: 1. 11000011 2. 11110010 3. 10010010 Convert the following from decimal to binary: 4. 254 5. 128 6. 33 Convert the following from hexadecimal to decimal: 7. F2 8. 1D 9. 50 Convert the following from decimal to hexadecimal: 10. 256 11. 89 12. 22 Convert the following from binary to hexadecimal: 13. 11001100 14. 11110000 15. 00111100 Evaluate the following equations: 16. 2 + 16 (33 + 22) / 6 17. 6 – 12 (2 + 12) Rewrite the following equations as you would in a computer program: 18. 𝐴𝐴 = 𝜋𝜋𝑟𝑟 2 19. 20. 𝑥𝑥 = 2 −𝑏𝑏±√𝑏𝑏 2 −4𝑎𝑎𝑎𝑎 2 2𝑎𝑎 𝑎𝑎 + 𝑏𝑏 = 𝑐𝑐 2 Copyright © Texas Education Agency, 2015. All Rights Reserved. 42 Numbering Conversions Test KEY Convert the following from binary to decimal: 7. 110000112 = 19510 8. 111100102 = 24210 9. 100100102 = 14610 Convert the following from decimal to binary: 10. 25410 = 111111102 11. 12810 = 100000002 12. 3310 = 001000012 Convert the following from hexadecimal to decimal: 21. F216 = 24210 22. 1D16 = 2910 23. 5016 = 8010 Convert the following from decimal to hexadecimal: 24. 25610 = 10016 25. 8910 = 5916 26. 2210 = 1616 Convert the following from binary to hexadecimal: 27. 110011002 = CC16 28. 111100002 = F016 29. 001111002 = 3C16 Evaluate the following equations: 30. 2 + 16 (23 + 22) / 6 = 8210 31. 6 – 12 (2 + 12) = -3010 Rewrite the following equations as you would in a computer program: 32. 𝐴𝐴 = 𝜋𝜋𝑟𝑟 2 A = 3.14 * r^2 33. 34. 𝑥𝑥 = −𝑏𝑏+𝐴𝐴𝐴𝐴 2𝑎𝑎 2 𝑎𝑎2 + 𝑏𝑏 = 𝑐𝑐 2 x = (-b + A *C) / (2 * a) c^2 = a^2 + b^2 Copyright © Texas Education Agency, 2015. All Rights Reserved. 43