XOR() function

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section: Chapter Questions
Problem 12PP
icon
Related questions
Question

Open Excel and Copy the Worksheet

Open MS Excel and copy the spreadsheet shown in Figure 1.

 Figure 1            Template for the XOR Spreadsheet    

Figure 1
A
1 given character
2
ASCII equivalent
3
4
5
6
7
XOR result
8
XOR binary
9 cipher character
10
given key
ASCII equivalent
BHN
72
N
Template for the XOR Spreadsheet
C D E F
G
H
122
0 1 0
0
1 1
0
1
1
1
I
0
0
J K L
0
1
0
0
The above worksheet displays a given character to be encoded the ASCII
Transcribed Image Text:Figure 1 A 1 given character 2 ASCII equivalent 3 4 5 6 7 XOR result 8 XOR binary 9 cipher character 10 given key ASCII equivalent BHN 72 N Template for the XOR Spreadsheet C D E F G H 122 0 1 0 0 1 1 0 1 1 1 I 0 0 J K L 0 1 0 0 The above worksheet displays a given character to be encoded the ASCII
In cell D7, type and enter the following formula, which performs an XOR
operation on the binary digits located within cells D2 and D5.
=NOT(OR(AND(D2,
D5), NOT(OR(D2,D5))))
If available, you can use the MS Excel intrinsic (built-in) XOR() function that
performs the same operation as the above formula.
Perform a " drag-and-fill " worksheet row seven and similarly formulate the
cells across the cell range E7:K7.
Notice that the formula either returns TRUE or FALSE for the cells in the range
D7:K7. You can double-click between the column labels, at the top of your
worksheet, to increase the column width to properly display the result.
You will now convert a TRUE to a "1" and a FALSE to a "0".
To accomplish this, type and enter the following formula in cell D8.
=IF(D7=TRUE,1,0)
Perform a " drag-and-fill" worksheet row eight and similarly formulate the cells
across the cell range E8:K8.
Use the Window's Calculator program, in the [ Programmer ] view, to convert
the 8-bit number in row eight to a decimal number.
Then, click cell B9 and type the following formula in this cell, replacing the word
"decimal" with the number that you just computed.
=CHAR(decimal)
You have just encoded the given character, using the given key, of the lower
case letter "z", with XOR encryption.
Transcribed Image Text:In cell D7, type and enter the following formula, which performs an XOR operation on the binary digits located within cells D2 and D5. =NOT(OR(AND(D2, D5), NOT(OR(D2,D5)))) If available, you can use the MS Excel intrinsic (built-in) XOR() function that performs the same operation as the above formula. Perform a " drag-and-fill " worksheet row seven and similarly formulate the cells across the cell range E7:K7. Notice that the formula either returns TRUE or FALSE for the cells in the range D7:K7. You can double-click between the column labels, at the top of your worksheet, to increase the column width to properly display the result. You will now convert a TRUE to a "1" and a FALSE to a "0". To accomplish this, type and enter the following formula in cell D8. =IF(D7=TRUE,1,0) Perform a " drag-and-fill" worksheet row eight and similarly formulate the cells across the cell range E8:K8. Use the Window's Calculator program, in the [ Programmer ] view, to convert the 8-bit number in row eight to a decimal number. Then, click cell B9 and type the following formula in this cell, replacing the word "decimal" with the number that you just computed. =CHAR(decimal) You have just encoded the given character, using the given key, of the lower case letter "z", with XOR encryption.
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,