Introduction to Embedded Systems Flashcards
What are the two options for binary?
0 or 1
What are the options for Hexadecimal?
0-9, A, B, C, D, E, F
How many bits does a binary digit take up?
1 bit
How many bits are in a byte?
8
What number does 1101 represent?
13
2^3 + 2^2 + 2^0 = 13
Regarding voltage, what do 0 and 1 represent?
0 = Low Voltage
1 = High Voltage
What are the prefix’s for writing binary numbers?
0b
0B
B
What are the prefix’s for a hexidecimal number?
0x
0X
What is 0b01101010 in Hexadecimal?
0x6A
What is 0x2E in Binary?
0b00101110
How do we notate Not in coding?
Y = ~A
Y is not A
If x=0xE3 and y=~x, what is y?
0x1C
How do we notate AND in coding?
Y=A&B
If a = 0b01010110 and b = 0b10100101, and y=a&b, what is y?
y = 0b00000100
How do we notate Or in coding?
Y=A|B
If a = 0b00111011, b = 0b11100010, and y=a|b, what does y equal?
y = 0b11111011
What does XOR represent?
An exclusive or, meaning that only one of the options can be positive to receive a positive output
How do we represent XOR in code?
Y=A^B
If a = 0b01100011, b = 0b11011010 and y = a^b, what does y equal?
y = 0b10111001
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?
If x=5, then y = 5+2 = 7
If x=12, then y = 2 * 12 = 24
Why do we use Setup Loops?
We can setup initial variables, and this section of code will only run once
What is the numerical order of these pins?
xxxx xxxx
7654 3210
Using the DDRx (Data Direction Register), how do we make all of the pins on port A input pins?
DDRA = 0b00000000;
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?
DDRB = 0b00001111;