Past-paper question · 2016 October-November · Paper 42 · Q3(a)(ii)

Question 3(a)(ii) 2016 · October-November · Paper 42 · 2 marks

Original past-paper question for 3(A)(II)
Original past-paper question for 3(A)(II)
Original past-paper question for 3(A)(II)
Original past-paper question for 3(A)(II)
Original past-paper question for 3(A)(II)
Reveal official mark-scheme answer Official mark-scheme answer for 3(A)(II)Official mark-scheme answer for 3(A)(II)

Official answer for Question 3

Part (a)

(ii)

(ii)

1 mark per bullet to max 2:

[2]
  • 00100000
  • OR
✓
Mark Scheme
✓
Syllabus
✓
Paper
✓
Cambridge International A Level – October/November 2016
✓
9608

Question 42

Mark scheme 9608_w16_ms_42.pdf →

Show text version of question

Question 3

Part (a)

(ii)

The numerical difference between the ASCII code of an upper case letter and the ASCII code of its lower case equivalent is 32 denary (3210).

For example, 'F' has ASCII code 70 and 'f' has ASCII code 102.

Bit number 7 6 5 4 3 2 1 0 ASCII code ASCII code in binary 70 0 1 0 0 0 1 1 0

102 0 1 1 0 0 1 1 0

The bit patterns differ only at bit number 5. This bit is 1 if the letter is lower case and 0 if the letter is upper case.

Question 11

(ii)

A program needs a mask to ensure that a letter is in lower case.

Write the binary pattern of the mask in the space provided in the table below.

Bit number 7 6 5 4 3 2 1 0 ASCII code ASCII code in binary 70 0 1 0 0 0 1 1 0

102 0 1 1 0 0 1 1 0

Mask

Give the bit-wise operation that needs to be performed using the mask and the ASCII code.

.......................................................................................................................................[2]

Question 12

The following table shows part of the instruction set for a processor which has one general purpose register, the Accumulator (ACC), and an index register (IX).

Instruction Op Operand Explanation code LDM #n Immediate addressing. Load the number n to ACC. Direct addressing. Load the contents of the given address to LDD <address> ACC. Indexed addressing. Form the address from <address> + LDX <address> the contents of the index register. Copy the contents of this calculated address to ACC. LDR #n Immediate addressing. Load the number n into IX. STO <address> Store the contents of ACC at the given address. INC <register> Add 1 to the contents of the register (ACC or IX). CMP <address> Compare the contents of ACC with the contents of <address>. CMP #n Compare the contents of ACC with number n. Following a compare instruction, jump to <address> if the JPE <address> compare was True. Following a compare instruction, jump to <address> if the JPN <address> compare was False. Bitwise AND operation of the contents of ACC with the AND #n operand. Bitwise AND operation of the contents of ACC with the AND <address> contents of <address>. Bitwise XOR operation of the contents of ACC with the XOR #n operand. Bitwise XOR operation of the contents of ACC with the XOR <address> contents of <address>. OR #n Bitwise OR operation of the contents of ACC with the operand. Bitwise OR operation of the contents of ACC with the contents OR <address> of <address>. Output to the screen the character whose ASCII value is OUT stored in ACC. END Return control to the operating system.

A
programmer is writing a program that will output the first character of a string in upper case and

the remaining characters of the string in lower case.

The program will use locations from address WORD onwards to store the characters in the string. The location with address LENGTH stores the number of characters that make up the string.

Question 13

The programmer has started to write the program in the following table. The comment column contains descriptions for the missing program instructions.

Topic relevance

Why this question appears here

72% assigned-topic match · Hardware › Logic gates and logic circuits

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9608_w16_qp_42.pdf

Keep practising this topic