Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Bitwise Operations Convert the integers 57 and 123 into one byte binary and hex. Show your work. Call the resulting hex values a and b.

Bitwise Operations

  1. Convert the integers 57 and 123 into one byte binary and hex. Show your work. Call the resulting hex values a and b.
  2. Compute the values of these Python Expressions:
    a | b a & b a ^ b 
  3. Convert the results from Part 2 to hex and decimal. Show your work.
  4. Write a Python script to verify the calculations in parts 2 and 3. Use the Bitwise Example to help you.
  5. The file quiz-scores.bin in the zip file quiz-scores.zip contains records with three fields each:
    Field Name Format Size
    first_name ASCII Code 8 bytes
    student_id Packed Decimal 4 digits representing decimal digits (2 bytes)
    quiz_answers Bit String 0 means F, 1 means T. 5 bits with 3 padding bits (1 byte)
    Use the hex dump utility to interpret the data in quiz-scores.bin. Here is a sample hex dump and interpretation of one record:
    > py hexdump.py examp.bin 00000 41 6c 69 63 65 20 20 20 12 34 68 A l i c e ^R 4 h 
    You can also redirect the dump from the Command Prompt Window to an output text file like this:
    > py hexdump.py examp.bin > dump.txt 
    Here is the hex dump for quiz-scores.bin in case you have trouble running hexdump.rb and saving the output. Include this dump in your submission for Project 1. Here is the interpretation of the hex dump for Alice: Interpretation: Field 1 (first_name): 41 6c 69 63 65 20 20 20 8 bytes: ASCII codes for Alice padded with three spaces. Field 2 (student_id): 12 34 2 bytes: The student id 1234 which consists of 4 packed decimal digits. Field 3 (quiz_answers): 68 = 01101000 1 byte: 01101 represents the answers to a true/false quiz F,T,T,F,T, with 3 zero bits of padding.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications Dexa 2023 Workshops 34th International Conference Dexa 2023 Penang Malaysia August 28 30 2023 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Maqbool Khan

1st Edition

303139688X, 978-3031396885

More Books

Students also viewed these Databases questions