Introduction to Embedded Systems Flashcards

1
Q

What are the two options for binary?

A

0 or 1

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

What are the options for Hexadecimal?

A

0-9, A, B, C, D, E, F

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

How many bits does a binary digit take up?

A

1 bit

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

How many bits are in a byte?

A

8

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

What number does 1101 represent?

A

13
2^3 + 2^2 + 2^0 = 13

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

Regarding voltage, what do 0 and 1 represent?

A

0 = Low Voltage
1 = High Voltage

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

What are the prefix’s for writing binary numbers?

A

0b
0B
B

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

What are the prefix’s for a hexidecimal number?

A

0x
0X

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

What is 0b01101010 in Hexadecimal?

A

0x6A

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

What is 0x2E in Binary?

A

0b00101110

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

How do we notate Not in coding?

A

Y = ~A
Y is not A

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

If x=0xE3 and y=~x, what is y?

A

0x1C

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

How do we notate AND in coding?

A

Y=A&B

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

If a = 0b01010110 and b = 0b10100101, and y=a&b, what is y?

A

y = 0b00000100

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

How do we notate Or in coding?

A

Y=A|B

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

If a = 0b00111011, b = 0b11100010, and y=a|b, what does y equal?

A

y = 0b11111011

17
Q

What does XOR represent?

A

An exclusive or, meaning that only one of the options can be positive to receive a positive output

18
Q

How do we represent XOR in code?

A

Y=A^B

19
Q

If a = 0b01100011, b = 0b11011010 and y = a^b, what does y equal?

A

y = 0b10111001

20
Q
unsigned char x;
unsigned char y;
if (x>=10){
y=2*x}
else{
y=x+2}

If x=5, what does y equal?
If x=12, what does y equal?

A

If x=5, then y = 5+2 = 7
If x=12, then y = 2 * 12 = 24

21
Q

Why do we use Setup Loops?

A

We can setup initial variables, and this section of code will only run once

22
Q

What is the numerical order of these pins?
xxxx xxxx

A

7654 3210

23
Q

Using the DDRx (Data Direction Register), how do we make all of the pins on port A input pins?

A
DDRA = 0b00000000;
24
Q

Using the DDRx (Data Direction Register), how do we make the lower 4 bits of port b as an output, and the higher 4 bits as an input?

A
DDRB = 0b00001111;
25
Q

What code do we use to output 0xFF on port B?

A
DDRB = 0b11111111; //Sets all pins of port B as outputs
PORTB = 0xFF; //Write's the data onto the ports
26
Q

Write a program to output a square wave to turn on the LED connected at pin PL2 (digital pin 47)

A

Step 1: Set PL2 as an output
Step 2: Create the main code

DDRL | = 0b00000100; //An alternative is DDRL | = 1<<2
PORTL | = 0b00000100; //This makes the high value
delay(1000);
PORTL & = 0b11111011; //This makes the low value
delay(1000);