bit, binary, bytes, unicode, ASCII, Typed arrays, buffers & how characters are displayed Flashcards

1
Q

When will we encounter Typed arrays?

A

When working with WebGL, Canvas, Web Audio API, xhttpRequets, Fetch API, websockets, Web workers, Media Source API and file APIs

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

When you created a typed arrays and setup the dataviews to access them what are the values initialized as?

A

0

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

What are typed arrays?

A

Typed Arrays are ways to store a whole bunch of bytes as one big block and access them as if it where an array. Every single byte will be one value you put in an array buffer.

Typed arrays are a good way for javascript to deal with binary data.

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

What are dataviews used for?

A

We access typed arrays with a data view that allows us to read and write the values that are inside of the typed arrays.

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

How do we create a new typed array?

A

let buffer = new ArrayBuffer(16);

https://www.youtube.com/watch?v=UYkJaW3pmj0

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

How do we create a new dataview?

A

let dv = new Dataview(buffer);

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

What is a byte?

A

A group of binary digits, a group of 8 bits equals a byte and can represent 255 at a max.

The largest integer that can be represented in one byte is: 11111111 which is 128+64+32+16+8+4+2+1 = 255. Thus, the largest decimal integer you can store in one byte is 255. (in an unsigned byte)

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

What is a bit?

A

A bit is the smallest unit of storage. A bit stores a 0 or 1. Anything with two separate states can store 1 bit
In a chip: electric charge = 0/1.

A bit is too small to be much use beyond this.

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

Typically how much information can be displayed with 1 byte?

A

1 byte is enough space to hold about 1 typed character e.g B,X, or $

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

What is ASCII Code?

A

ASCII is an encoding representing each typed character by a number
Each number is stored in one byte (so the number is in 0..255)

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

What is Unicode?

A

“Unicode” is an encoding for mandarin, greek, arabic, etc. languages, typically 2-bytes per “character”

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

How many bytes can the different measures of storage take?

A

Kilobyte, KB, about 1 thousand bytes
Megabyte, MB, about 1 million bytes
Gigabyte, GB, about 1 billion bytes
Terabyte, TB, about 1 trillion bytes (rare)

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

What is a byte used for?

A

good at using the bits to store information. E.g

Really good for storing characters/letters, images, etc.

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

Source

A

https://web.stanford.edu/class/cs101/bits-bytes.html

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