Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

6. I bet you thought you were done with XOR. Nope, sorry. XOR is magical, so I'm going to force feed it to you. Feast

image text in transcribed

image text in transcribed

6. I bet you thought you were done with XOR. Nope, sorry. XOR is magical, so I'm going to force feed it to you. Feast on the magic and thank me later. a) Let us begin with two 8-bit binary strings, A and B. Assume at first A = 01001010 and B has the same value. Take A and B and XOR them together in a bitwise fashion (XOR each bit of A with each bit of B. What bit string do you end up with? b) Now keep A the same and change B to 01001110 (weve flipped one bit of B). XOR them together again. What do you get now? c) Now set B to -A. XOR them together. What do you get? d) What conclusions can you draw from this? e) Using the conclusions youve drawn, outline a procedure for how you'd calculate how far two binary strings are from one another', namely how many bit positions differ between the two strings? Pseudocode, C code, or a summary are fine here. unsigned char x = a ^ b; // a XOR b (a and b unsigned differ = 0; for i = 0; i

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

Step: 3

blur-text-image

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

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions