Data types

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/25

flashcard set

Earn XP

Description and Tags

Created from P.M.T and Ada Comp. Sci. notes

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

26 Terms

1
New cards

What number base is binary?

Base 2

2
New cards

What number base is denary?

Base 10

3
New cards

What number base is hexadecimal?

Base 16

4
New cards

Why is hexadecimal often shown to humans insted of binary?

  • It is easier to read and interpret…

  • … and uses less characters…

  • … so is less likely to be written or read incorrectly

5
New cards

Most significant bit (MSB) of a binary number

Bit that is furthest to the left

6
New cards

Least significant bit (LSB) of a binary number

Bit that is furthest to the right

7
New cards

Bit

A single binary digit

8
New cards

Byte

8 bits

9
New cards

Nybble

4 bits; half a byte

10
New cards

Two methods of representing negative numbers in binary

  • Sign and magnitude

  • Two’s complement

11
New cards

How does sign and magnitude represent numbers?

  • MSB is a sign bit - 0 means positive, 1 means negative. This is equivelent to adding a + or - in front of the number

  • The rest of the bits show the magnitude (size) of the number

  • Example: 01100 →+(8+4)→ 12, and 11100→ -(8+4)→ -12

12
New cards

How does sign and magnitude represent numbers?

  • Makes the MSB negative (e.g. in 8 bit number MSB is usually 128, bit in ___ it is -128)

  • Rest of the bits are normal

  • Example, 01100→(8+4)→12, 10100→(-16+4)→ -12

13
New cards

How do you turn a positive number to its negative equivelent in two’s complement?

  • Flip all the bits and add one

  • Example: 24=011000, flip bits→100111, add one→101000=-24

14
New cards

How to turn a negative number to its positive equivelent in two’s complement

  • Subtract one and flip all the bits

  • Flip all the bits and add one

  • Example: -19=101101, subtract one→101100, flip bits→010011=19

15
New cards

Advantage of two’s complement over sign and magnitude

Makes binary arithmetic with negative numbers much more simple

16
New cards

Disadvantage of sign and magnitude

  • Makes binary arithmetic with negative numbers more complicated

  • As such it is rarely used in modern systems

17
New cards

You have a fixed number of bits to store a real binary number. Describe the trade-off between accuracy and range when deciding how many bits to use for the mantissa and exponent.

  • The larger the mantissa the more accurate the number

  • The larger the exponent the greater the range of numbers that can be stored

18
New cards

What does the start of a normalised floating point number start with

  • 01 for positive numbers

  • 10 for negative numbers

19
New cards

What us a character set?

The characters a computer uses / understands

20
New cards

How is a character set used to represent text in a computer?

  • Each character is assigned a unique character code

  • Each letter is converted to its character code (which is a binary number)

21
New cards

What would happen if computers were to use different character sets when communicating?

  • Characters from a computer using one characterset will be interpreted as different characters by a computer using another character set.

  • As such text will be incomprehensible.

22
New cards

Explain how computers are able to represent text.

  • Computers use a character set to map binary values to characters

  • Each character is represented by a unique value called a bit pattern

23
New cards

Similarities between ASCII and UNICODE

  • Both are character sets

  • The first 8 bits of UNICODE are the same as ASCII

24
New cards

Disadvantages of ASCII

  • Has a very limited number of characters so is not suitable for multilingual text

25
New cards

Advantages of UNICODE over ASCII

  • Can represent more characters

  • Can represent foreign alphabets

  • Can represent emojis and symbols

26
New cards

Disadvantages of UNICODE

  • Can take up more storage space