




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
workbook for Assembly language vc++ and java
Typology: Exercises
1 / 109
This page cannot be seen from the preview
Don't miss anything!





























































































Republic of the Philippines SULTAN KUDARAT STATE UNIVERSITY Kalamansig Campus Kalamansig, Sultan Kudarat
Compiled by:
MAILYNE V. BACONGCO, CpE
SKSU Vision
A trailblazer in art, science and technology in the region.
SKSU Mission
The University shall primarily provide advanced instruction and professional training in science and technology, agriculture, fisheries, education and other relevant fields of study. It shall also undertake and extension services, and provide progressive leadership in its areas of specialization.
Activity 3: Supply the actual binary bits Activity 4: Supply the normalized value and resulting exponent Activity 5: Supply the complete binary Practice and Application Activity 6: Do it yourself Closure Activity 7: Show Me the Value Lesson 4: Addition and Subtraction Instructions Introduction Learning Outcome Activating Prior Knowledge Activity 1: Valid or Invalid Setting the Context Activity 2: Valid or Invalid Activity 3: Carry or No carry Activity 4: Zero or Not Zero Activity 5: Positive or Negative Activity 6: Carry, Sign, and Zero Practice and Application Activity 7: Do it yourself Lesson 5: Direct Memory Operands Introduction Learning Outcome Activating Prior Knowledge Activity 1: Valid or Invalid Activity 2: Valid or Invalid Setting the Context Activity 3: Hexadecimal Value Activity 4: Hexadecimal Value Activity 5: Hexadecimal Value Activity 6: Hexadecimal Value Practice and Application Activity 7: Do it yourself Part II: VC++ Lesson 6: Introduction to Hardware and Software Introduction Learning Outcome Activating Prior Knowledge Activity 1: H or S Setting the Context Activity 2: Guess Me Activity 3: 8-bit to decimal and hex Activity 4: 16-bit to decimal and hex Activity 5: ASCII codes in decimal, hex and binary Activity 6: Solve for x Practice and Application
Activity 7: Interpretation Lesson 7: A First Look at a C++ Program Introduction Learning Outcome Activating Prior Knowledge Activity 1: True or False Setting the Context Activity 2: Identification Activity 3: True or False Activity 4: Always, Sometimes, or Never Activity 5: Fill in the Blank Activity 6: Encircle Me Activity 7: True or False Practice and Application Activity 8: Do it yourself Lesson 8: Variables and Constants Introduction Learning Outcome Activating Prior Knowledge Activity 1: Encircle Me Setting the Context Activity 2: True or False Practice and Application Activity 3: Do it yourself Lesson 9: Arithmetic Expressions Introduction Learning Outcome Activating Prior Knowledge Activity 1: Find the Output Setting the Context Activity 2: Fix the Bug Activity 3: True or False Activity 4: Fill in the Blank Practice and Application Activity 5: Write a program Lesson 10: Arrays, apvector and apmatrix Classes Introduction Learning Outcome Activating Prior Knowledge Activity 1: True or False Setting the Context Activity 2: Valid or Invalid Practice and Application Activity 3: Test my Program Activity 4: Fix the Bug
Introduction
Every number system uses positional notation i.e., each position in which a digit is written has a different positional value. Each position is power of the base, which is 2 for binary number system, and these powers begin at 0 and increase by 1.
Hexadecimal number system uses base 16. The digits range from 0 to 15. By convention, the letters A through F is used to represent the hexadecimal digits corresponding to decimal values 10 through 15. Main use of hexadecimal numbers in computing is for abbreviating lengthy binary representations. Basically hexadecimal number system represents a binary data by dividing each byte in half and expressing the value of each half-byte.
Learning Outcomes
At the end of the lesson the students can solved the following types of problems: a. Identify positional values for an 8-bit binary numbers; b. Write the equivalent binary and hexadecimal representation of decimal number; c. Convert decimal to binary, binary to decimal, hexadecimal to decimal, binary to hexadecimal, and hexadecimal to binary; and d. Solved any number system to its desired base.
Activating Prior Knowledge
Directions: Fill the missing positional values for an 8-bit binary number, where all bits are set on. Bit number 7 was already done for you.
Bit Value 1 1 1 1 1 1 1 1 Position value as a power of base 2
Bit number 7 6 5 4 3 2 1 0
Directions: Complete the table by writing the equivalent binary and hexadecimal representation of decimal number. Decimal number 2 was already done for you.
Decimal Number Binary Representation Hexadecimal Representation 0 1 2 0010 2 3 4 5 6 7 8 9
Setting the Context
Directions: Write each of the following decimal numbers in binary:
Directions: Write each of the following Hexadecimal numbers in Decimal:
Comprehension Check
Directions: Convert the following number system to its desired base. Number 1 is provided for you. Write your Solution and answer in the space provided.
Solution: 374/2 = 0 Answer: 101110110 2 187/2 = 1 93/2 = 1 44/2 = 0 23/2 = 1 11/2 = 1 5/2 = 1 2/2 = 0 ½ = 1
Solution:
Solution:
Solution:
c. 10110 – 01101 =
d. 11111 – 01011 =
a. 82CD + 1982 = c. FB28 – 3254 =
b. E2C + A31 = d. E2C – A31 =
a. BBCA270C d. 5FCA +AE223464 +AE
b. E3BA265F e. 80000000
a. E9B20F5D f. 6D4AFBC +FE605C8D +F89ABCDE
Closure
Directions:
Introduction
In mathematics, the additive inverse of a number n is the value, when added to n, produces zero. Programs often include both subtraction and addition operations, but internally, the CPU really only performs addition. To get around this restriction, the computer uses the additive inverse. When subtracting A-B, the CPU instead performs A+ (-B).
Learning Outcome At the end of the lesson the students can solved the following types of problems: a. write the equivalent negative binary numbers of positive numbers; b. write signed decimal integers in 8-bit binary notation; c. identify the valid 16-bit signed decimal integers; and d. perform subtraction of unsigned decimal number.
Activating Prior Knowledge
Directions: Write the equivalent negative binary number of the following positive number. Number 1 was already done for you.
1. Number +53 00110101 Reverse the bits 11001010 Add 1 1 Number - 53 11001011
Number +36 00110101 Reverse the bits 11001010 Add 1 1 Number -
Directions: Match column A to column B by drawing a line connecting to its equivalent decimal. Number 1 was already done for you provided.
Column A Column B
Directions: Which of the following integers are valid 16-bit signed decimal integers? Write your answer in the box provided. (Indicate V=valid, I=invalid)
Directions: Indicate the sign of each of the following 16-bit hexadecimal integers: Write your answer in the box provided. (indicate P=positive, N=negative)
Directions: Write each of the following signed decimal integers as a 16-bit hexadecimal value. Write your answer in the box provided.
Solution:
Solution:
Closure
Directions: Perform the subtraction with the following unsigned binary numbers by taking the 2’s complement of the subtrahend. Write your answer in the box provided.
Solution:
Solution: