computer science 13,14,15,16,17,18 Flashcards
(42 cards)
describe the purpose of a user defined data type 2
- to create a new data type from existing data types
- to extend the flexibility of the programming language
explain how an interpreter executes a program without producing a complete translated version of it 4
- an interpreter examines the source code 1 line at a time
- and checks each statement for errors
- if no error is found, the statement is executed
- if an error is found, it’s reported and the interpreter haults
explain why the reverse polish notation (RPN) is used to carry out the evaluation of expressions 2
- RPN provides an unambiguous method of representing an expression
- reading from left to write
identify with reasons, a data structure that could be used to evaluate an expression in RPN 2
structure: stack
- the operands are popped from the stack in the reverse order to how they were pushed
give 2 benefits and 2 drawbacks of packet switching 4
benefit 1: accuracy - it ensures accurate delivery of the message
benefit 2: completeness: missing packets can be easily detected and a re-send request is sent so the message arrives complete
drawback 1: network problems may introduce errors in the packets
drawback 2: it requires complex protocols for delivery
explain he reason why binary numbers are stored in normalised form 3
- to store the maximum range of numbers in the minimum number of bits
- it enables very large numbers to be stored with accuracy
- it avoids the possibility of many numbers having multiple representations
compare sequential and serial methods of file organisation 4
- in both , records are stored one after the other and need to be accessed one after the other
- serial files are stored in chronological order
3.sequential files are stored with ordered records
- in serial, new records are added in the next available space
- in sequential, new records are inserted in the correct position
state the most suitable method of file access when a record is referenced by a unique address on a disk-type storage medium 1
direct acess
state the most suitable method of file access when a bank stores its data records in ascending order of account number 1
sequential access
explain how packet switching is used to transfer messages across the internet 5
- a large message is divided up into a group of smaller chunks of the same size called ‘packets’
- the packet has a header and payload
- the header contains a source IP address, destination IP address and sequence number
- each packet is dispatched independantly
- the packets may arrive out of order
outline the function of a router in packet switching 3
- the router examines the packet’s header
- a router has access to a routing table
- containing information about e-gateways
a record is a user-defined composite data type
explain what is meant by a user-defined composite data type and include an example of another user-defined composite data type 3
a composite data type refers to other/many types, user-defined data types created by the programmers to suit specific needs. an example, in python, you can create user-defined data types using classes
describe what is meant by RISC and CISC processors ( 2 points for each)
RISC- it uses simple instructions and fixed length instructions
CISC- it uses many instruction formats and uses variable length instructions
identify 2 differences between RISC and CISC processors 2
RISC has fewer instructions while CISC has more instructions
RISC has many registers while CISC has fewer registers
outline the functions of the Transport and Internet layers of the TCP/IP protocol suite 5
Transport layer:
- it regulates the network connections
- data is broken up into packets which are then sent to the internet layer
internet layer:
- it identifies the intended network and host
-it moves traffic across local segments
-encapsulates IP packets into frames for transmission
state what is meant by enumerated data type
a non-composite user-defined data type defined by a given list of all possible values
what is meant by the term pointer data type
a non composite data type that uses memory address of where the data is stored
describe the process of pipelining during the fetch execute cycle in RISC processors 4
- instructions are subdivided into tasks
-each subtask is completed during one clock cycle
-No 2 instructions can be executed during the same stage at the same clock cycle
-the second instruction begins in the second clock cycle while the first instruction has moved on to it’s second subtask
explain why a protocol is used in communication between computers 2
- both parties need to agree the protocol being used to ensure successful communication, eg. parity checking, without agreeing this protocol, it would be impossible to do a parity checking
describe the purpose of IMAP protocol
it’s a pull protocol used when receiving emails from an email server
describe how records are organised and accessed in a sequential file 3
- records are stored one after the other and are accessed one after the other
- the files are stored in particular order.
3.new records are added based on the key field
state 2 examples where it would be appropriate to use packet switching 2
- commonly used on data networks such as the internet to send large data files that don’t need to be to be live streamed
- used for emails text messages, documents
describe the use of pipelining in RISC 2
- pipelining allows several instructions to be processed simultaneously
2.each instruction is completed during one clock cycle
explain the use of graphs to aid AI 3
- graphs provide structures for relationships
- graphs may be analysed
- Artificial Neural Networks can be represented using graphs