Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started