WJEC A-Level Computer Science 601-5345-3
Hardware: Architecture, Memory and Storage
Networks and Data Transmission
Logic Gates and Boolean Algebra
Data Representation and Data Types
Data Structures
Organisation of Data: Files and Records
Database Systems
The Operating System
Algorithms and Programs
Principles of Programming
Systems Analysis
Software Engineering and Program Construction
Types of Software System
Practical Programming
Data Security and Integrity
Computing, Society and the Law
Advanced Data Structures and Logic
Recursion, Sorting and Searching
Programming Paradigms and Translators
System Design and Human-Computer Interaction
Software Engineering Tools and Professional Practice
Advanced Architecture and Assembly Language
Communication Networks and File Organisation
Number Representation and Floating Point
Databases and Distributed Systems
Operating System Management
Software Systems and Applications
Data Security, Cryptography and Attack
Advanced Data Structures and Logic
Masking, clearing registers and encryption
- 3 things to know
- A2 Unit 3
Overview
Recall questions on why a bitwise operation covers a whole register at once, extracting the upper nibble, setting and inverting chosen bits, clearing a register, testing for an even number, XOR encryption worked in binary, extracting a colour component, and the weakness of a short repeating key.
What you need to know
Answer each one before you reveal it.
Why can a bitwise operation be applied to a whole register in a single instruction rather than one bit at a time?
Which operation and mask force bit 3 of a byte to 1 without disturbing any other bit?
Questions from this subtopic
Each one with the model answer underneath.
- 1
Why can a bitwise operation be applied to a whole register in a single instruction rather than one bit at a time?
Model answer
Every bit position has its own logic gate and all of them operate at once, so the whole word is processed within one machine cycle.
- 2
Which operation and which mask extract the upper four bits of a byte, and what must follow?
Model answer
The byte is ANDed with 11110000 in binary, and the result is then shifted right four places so that the nibble sits in the low bits.
- 3
Calculate 11010110 AND 11110000, giving the result in binary and in denary.
Model answer
The result is 11010000 in binary, which is 208 in denary.
- 4
Which operation and mask force bit 3 of a byte to 1 without disturbing any other bit?
Model answer
The byte is ORed with 00001000 in binary, which sets that bit while leaving every bit paired with a 0 unchanged.
- 5
Which operation and mask invert the lower nibble of a byte while leaving the upper nibble alone?
Model answer
The byte is XORed with 00001111 in binary, because XOR with 1 inverts a bit while XOR with 0 reproduces it.
- 6
State the quickest way a processor can force a register to zero using a logical operation, and explain why it works.
Model answer
The register is XORed with itself, because every bit is then paired with a copy of itself and XOR of two equal bits is 0.
Other ways to work this
The same content, four other ways.
What is inside Levo
Six ways to work the same material.
Every question in Advanced Data Structures and Logic, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.