extras Flashcards

1
Q

What is the purpose of a D type flip flop?

A

Stores the value of one bit when a clock signal is given.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does it work?

A

There is a clock input and data input. Every time the clock input is high, the output is set to the data input.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Where are d type flip flops used?

A

Synchronised data transfer within circuits by making sure the output only changes at times determined by the clock signal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the purpose of an adder circuit?

A

Add two binary numbers together.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the difference between a half and full adder?

A

A half adder takes in 2 bits and returns the sum and carry.

A full adder takes in 3 bits (2 and a carry) and returns a sum and carry.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What happens when data is sent on data bus to read or write?

A

control bus sends read/write signal before data is transmitted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you write an attribute in oop pseudocode?

A

private attributename

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you write a constructor method in oop pseudocode?

A

public procedure new(parameters)

example

endprocedure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you write any other method in oop pseudocode?

A

public procedure functionname()…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What if the method returns a value?

A

public function name()…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you create a new object?

A

objectname = new classname(arguments)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you create a child class?

A

class childname inherits parentname

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you call a parent class method in a child class?

A

super.methodname()
or super.new()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does string[:n] do?

A

gives all the characters before n not including n’s position

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does string[n:] do?

A

gives all the characters after and including n’s position

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you read a file in python?

A

f = open(“name.txt”,”r”)
print(f.read())

17
Q

How do you read a line of a file in python?

A

f = open(“name.txt”,”r”)
print(f.readline())

18
Q

How do you close a file in python?

A

f.close()

19
Q

How do you write to a file in python?

A

f = open(“name.txt”,”a”)
f.write(“newtext”)

20
Q

How do you comment in python.

A

#