Data Types- S6 Flashcards

1
Q

Give all data types

A

Integer, String, Float, Character, Boolean, Data

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

What base is Binary in

A

2

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

What are the addition rules

A

0+0=0
0+1=1
1+1= 0 and carry 1
1+1+1= 1 and carry 1

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

Explain why addition of binary numbers can be wrong?

A

Overflow can occur if you end up with a binary number with more bits than you can have. If the binary number is also then two’s compliment or sign and magnitude it could make the binary number seem positive or negative when its not.

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

What is sign and magnitude

A

the leftest most bit represents the sign only and the rest is the magnitude (the number). If the sign is 0 then positive, if 1 then negative.

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

What is 1001010 if it is represented as sign and magnitude

A

-10

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

What is two’s compliment

A

the leftest most bit dictates whether the number is positive or negative. If it is 1, the binary needs to be inversed.

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

How do you inverse a binary in twos complimet

A

Go along from right to left. After the first 1 is encountered invert the rest of the number.

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

What is Floating point?

A

There is an mantis and exponent.

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

How do you convert a binary floating point and twos compliment to denary?

A

First separate mantisa and exponent. Put a decimal place between the leftest and second most left numbers on the mantisa. If 1.0 flip the mantisa, if exponent starts with 1 as well then flip. If exponent is negative move point to the left, if positive mover to the right.

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

How would you turn denary into floating point and twos compliment

A

Write in binary, put a . at the right end. Move the . to the left until 0. if negative invert now. If the decimal moved to the

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

How would you turn denary into floating point and twos compliment

A

Write in binary. Move the . to the left until 0. if negative invert now. If the decimal moved to the left the exponent is +the number of points moved . If point move to the right exponent is -the number of points moved.

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

Why is floating point used

A

for a bigger range, and to hold fractions

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

A bigger mantisa leads to… and a bigger exponent leads to…

A
>mantisa= more accurate
>exponent= bigger range
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a Character Set

A

The list of all the character recognised by the computer and each character is represented by it’s own unique code

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

What is UNICODE

A

A coding system that assigns unique codes to characters and covers all languages

17
Q

What is ASCI

A

each character is represented with a unique 7-bit binary number. 128 possible characters are defined.

18
Q

How many bits in a byte

A

8 bits in a byte

19
Q

Hexadecimal

A

a numerical notation using the base of 16 used as a shorthand for binary.

20
Q

How to turn denary to hexadecimal

A

First- Number DIV 16. If its bigger than 9, than use ABCDEF to represent it.
Second - Number MOD 16. If bigger than 9 use ABCDEF.

21
Q

Whats 170 in hex

A
A A 
(170 DIV 16=10) (170 MOD 16=10)
22
Q

How do you turn Binary to hex or vice versa?

A

Each hex represents four binary bits.