cambridge computer science as unit 6 and 7

5.0(1)
studied byStudied by 15 people
5.0(1)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/99

flashcard set

Earn XP

Description and Tags

cambridge computer science as, mrs. preston

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

100 Terms

1
New cards

The set of instruction are grouped into instruction for:

a. _____ movement

b. input and output of ______

c. _____ operations

d. unconditional and conditional _____

e. _____

data

data

arithmetic

jumps

comparison

2
New cards

Machine code consist of a sequence of _____

instructions

3
New cards

An instruction contains an _____

opcode

4
New cards

An instruction may not have an _____ but up to 3 _____ are possible

operand, operands

5
New cards

Different processors have _____ instructions sets associate with them

different

6
New cards

Different processors will have comparable instructions for the same operation, but the coding of the instruction will be _____

different

7
New cards

Define opcode

Defines the action associated with the instruction

8
New cards

Define operand

Defines any data needed by the instruction

9
New cards

Define machine code instruction

A binary code with a defined number of bits that comprises the opcode and, most often, one operand

10
New cards

What determines the number of bits needed for the opcode?

number of different opcodes in instruction set

11
New cards

What 3 factors does the opcode determine?

operation, address mode, register addressing

12
New cards

Why does the control check the opcode when an instruction arrives in the CPU?

To determine what action it defines

13
New cards

Machine code allows the programmer to _____ the processor

directly control

14
New cards

Writing a substantial program as a sequence of machine code instruction would take a _____ and most likely contain _____

very long time, several errors

15
New cards

Do all processors use the same assembly language?

No

16
New cards

Define assembly language

A low-level language related to machine code where opcodes are written as mnemonics and there is a character representation for an operand

17
New cards

Define assembler

A program used to translate an assembly language program into machine code

18
New cards

What is used to translate a program written in assembly language must into machine code?

Assembler

19
New cards

List advantages of using assembly language

  • code being easier to write

  • allows special features to be included in assembly language program

20
New cards

List examples of special features included in an assembly language program

  • comments

  • symbolic names for constants

  • labels for address

  • macros

  • directives

21
New cards

Define macro

A sequence of instructions used more than once in a program

22
New cards

Define directive

An instruction to the assembler program

23
New cards

Use of symbolic programming allows programmers to write assembly code without worrying about _____

where to store the code in memory

24
New cards

Define label

A sequence of characters that identifies a location within source code

25
New cards

Are labels used in symbolic addressing?

Yes

26
New cards

Are labels used in relative addressing?

No

27
New cards

Are labels used in absolute addressing?

No

28
New cards

What are the 2 ways that it is possible to write code without symbolic memory?

relative and absolute addressing

29
New cards

What is assumed when using relative addressing?

A special function base register, BR, contains the base address

30
New cards

Give examples of things an assembler must do with assembly language code before translating

a. removal of comments

b. replacement of a macro name used in an instruction by the list of instructions that constitute the macro

c. removal and storage of directives to be acted upon later

31
New cards

During first pass in a two-pass assembler is needed to identify what?

Addresses for forward references

32
New cards

During first pass in a two-pass assembler, how is the code read?

line by line

33
New cards

During first pass in a two-pass assembler, what is created?

Symbol table

34
New cards

During first pass in a two-pass assembler, what happens when a symbolic address is first encountered?

It is entered into the symbol table

35
New cards

During first pass in a two-pass assembler, when a symbolic address is first encountered, what additional actions must occur and when will it occur?

A corresponding address is added when the address can be identified

36
New cards

During first pass in a two-pass assembler, what must the assembler do as it reads the code?

Count instructions

37
New cards

During second pass in a two-pass assembler, what does the look up table provide?

Binary code for each opcode

38
New cards

Where can the binary code for every opcode in the set defined for the processor be found?

Look up table

39
New cards

Assuming no errors are found, what will the second pass produce?

A machine code program

40
New cards

In machine code, what do most instructions have and what is it?

An operand, a 16-bit binary number

41
New cards

In machine code, what does the operand usually represent?

An address

42
New cards

In machine code, for which instructions does the operand represent a value?

SUB, LDM

43
New cards

In machine code, which instructions have no operand?

IN, END

44
New cards

In machine code, which instructions is a special case?

INC

45
New cards

What makes the instruction INC special?

  • the operand in assembly code identifies the register

  • machine code: identified with opcode, no operand needed

46
New cards

Define addressing mode

When the instruction uses a value this defines how the operand is used to find a value

47
New cards

In our simple processor, how many bits of the opcode in the machine code instruction are used to define the addressing mode?

2

48
New cards

If our simple processor used four bits of the opcode in the machine code instruction to define the addressing mode, how many modes would be possible?

4

49
New cards

List all the different addressing modes, give the mode and how the operand is used

  • immediate: the operand is the value used

  • direct: the operand is the address with the value used

  • indirect: the operand is the address with the address with the value used

  • indexed: the operand is the address added with the IX value to find the value used

50
New cards

Explain the options available for immediate addressing

  • #n: denary value n

  • #B00110000: binary value equivalent to denary 48

  • #&30: hexadecimal value equivalent to denary 48

51
New cards

What does IX represent?

Index Register

52
New cards

What does data movement involve?

Loading data into register, storing data in memory

53
New cards

What does ACC represent?

Accumulator

54
New cards

How many input instructions exist?

1

55
New cards

How many output instructions exist?

1

56
New cards

Which, if any, input or output instructions have an operand?

None

57
New cards

How does the execution of a conditional begin?

A conditional jump begins by checking the flag

58
New cards

When a jump instruction is executed, what happens to the program counter?

It is overwritten with the new address

59
New cards

An assembly language contains assembly language _____ plus _____ that provide information to the assembler

instruction, directives

60
New cards

A two-pass compiler identifies _____ addresses for _____ addresses in the first pass

relative, symbolic

61
New cards

Assembly language instructions can be categorized as

data movement, input/output, compare and jump, arithmetic, shift and logical

62
New cards

What is used to monitor/control a device?

Bit manipulation

63
New cards

What can a monitoring system be used to create?

A record of the conditions of a system

64
New cards

A monitoring system is usually used to detect what?

When a particular physical property is outside a desired range

65
New cards

What is a measuring device that records a value that can be transmitted to the computer?

Sensor

66
New cards

What is a thermocouple?

A sensor for measuring temperature and outputs an electrical voltage changing with the temperature

67
New cards

What prevents a sensor from taking action?

It does not have built-in intelligence

68
New cards

What must happen if the sensor detects values in the danger range?

Sound an alarm

69
New cards

Give at least six examples of sensors

pressure, humidity, carbon monoxide, pH levels, sound, different types of infrared sensors, motion sensors

70
New cards

Define sensor

A hardware device that measures a property and transmits a value to a controlling computer

71
New cards

Define actuator

A hardware device that receives a signal from a computer and adjusts the setting of a controlling device

72
New cards

True or False: An environment is monitored so that it can be controlled

False

73
New cards

True or False: An environment that is controlled must be monitored

True

74
New cards

True or False: A sensor is used to monitor a system

True

75
New cards

True or False: A sensor must be recording data continuously

False

76
New cards

True or False: An actuator is used to control an environment or a system

True

77
New cards

True or False: If a sensor detects a problem in a controlled environment, it must send a signal to the appropriate actuator to correct the problem

False

78
New cards
<p>Label each component: 1</p>

Label each component: 1

computer or microprocessor

79
New cards
<p>Label each component: 2</p>

Label each component: 2

digital-to-analogue converter

80
New cards
<p>Label each component: 3</p>

Label each component: 3

analogue control signal

81
New cards
<p>Label each component: 4</p>

Label each component: 4

actuator

82
New cards
<p>Label each component: 5</p>

Label each component: 5

controlled device

83
New cards
<p>Label each component: 6</p>

Label each component: 6

sensor

84
New cards
<p>Label each component: 7</p>

Label each component: 7

analogue-to-digital converter

85
New cards
<p>Label each component: 8</p>

Label each component: 8

digital measured value

86
New cards

What is essential in a control system?

Feedback

87
New cards

A microprocessor functions as the controller and compares what values?

The actual output and desired output

88
New cards

What does the microprocessor do with the values?

Transfer to the actuator based on the difference between the actual and desired outputs

89
New cards
<p>Label each component: 1</p>

Label each component: 1

desired value for process output

90
New cards
<p>Label each component: 2</p>

Label each component: 2

controlling computer

91
New cards
<p>Label each component: 3</p>

Label each component: 3

actuator

92
New cards
<p>Label each component: 4</p>

Label each component: 4

controlling device

93
New cards
<p>Label each component: 5</p>

Label each component: 5

process

94
New cards
<p>Label each component: 6</p>

Label each component: 6

process output

95
New cards
<p>Label each component: 7</p>

Label each component: 7

sensor

96
New cards

How many Boolean variables are needed if a single property is to be monitor, can be too high, too low or in range?

2

97
New cards

How many Boolean variables are needed if a single property is to be monitor, can in range or out of range?

1

98
New cards

What does it mean to toggle a switch?

To change the value of the flag it represents

99
New cards

A monitoring system contains

a sensor

100
New cards

A control system contains

a sensor and actuator