Data types Flashcards

1
Q

What is a primitive data type?

A

A data type which is provided by a programming language
integer-whole number 2
real/float-decimal number 3.421
Boolean-true ,false
character-letter number symbol
string-anything enclosed in speech marks “peter” “9”

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

Hex

A

0-9:0-9

10-15:A TO F

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

Why to use hex?

A

Much easier to read and remember then a string of binary digits
quicker to write or type (only takes up one character)
less chance of making an error

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

What is a byte

A

A collection of 8 bits

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

Sign and magnitude

A

The first bit acts as the sign:
0 for +
1 for -

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

Two’s complement

A

Find value in binary if needed
Flip all the bits (0 to 1)
Add 1

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

What is ASCII

A

Each character of the alphabet and some special symbols and control codes are represented by agreed binary patterns
The ASC11 character set was original;y based on an 8-bit binary pattern using seven bits plus a single parity bit and was able to represent 128 separate characters
The extended ASC11 set uses eight bits and so can represent 256 separate characters
With just eight bits available in the ASC11 system the number of characters is limited to 256, making it impossible to display the wide range of characters for other alphabets or symbols sets

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

What is unicode?

A

Unicode was originally a 16-bit code allowing for more than 65000 characters were represented
This was updated to remove the 16-bit restriction by using a series of code pages with each page representing the chosen languages symbols
The original ASC11 representations have been included as part of the Unicode character set with the same numeric values.

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