CSC 156 Spring 2024 - Homework 7 (100 pts. total)
Assigned Mon Apr 1, due Wed Apr 10


BEFORE STARTING THIS ASSIGNMENT:
Before starting the exercises given below for each section, please make sure to read each section and check your understanding (by doing the participation exercises and those additional exercises with answers provided).

FOR ALL QUESTIONS IN THIS ASSIGNMENT:
Answer each question. *Make sure to justify your answer for all questions. Do NOT just state the answer.*

THE ASSIGNMENT:
  • [15 pts.] Question 1: Express the hexadecimal number 2B3 in binary and in decimal.
  • [15 pts.] Question 2: Express the hexadecimal number 1AFD in decimal.
  • [10 pts.] Question 3: Express the decimal number 361 in hexadecimal.
  • [10 pts.] Question 4: Convert each binary number into hexadecimal: a) 101011 b) 100100111111
  • [15 pts.] Question 5: In the RGB color system, a shade of dark green can be made using red = 0, green = 60, and blue = 20.
             a) Express this as a 3-byte binary number.
             b) Express this as a hexadecimal number.
  • [20 pts.] Question 6: Calculate the value of the following bitwise operations:
             a) !10100
             b) 10001 & 01011
             c) 10001 ^ 01011
             d) 01011 << 3
  • [15 pts.] Question 7: Given a 6-bit binary number x = b5b4b3b2b1b0, write a bitwise expression (in terms of x) that:
             a) gets the bit b4
             b) sets the bit b2 to 0
             c) sets the bit b3 to 1




    Last Modified: 4/3/24