An alternative to hexadecimal notation for representing bit patterns is dotted decimal notation in which each byte in the pattern is represented by its base ten equivalent. In turn, these byte representations are separated by periods. For example, 12.5 represents the pattern 0000110000000101 (the byte00001100 is represented by 12, and 00000101 is represented by 5), and the pattern 100010000001000000000111 is represented by 136.16.7. Represent each of the following bit patterns in dotted decimal notation,
a. 0000111100001111 b. 001100110000000010000000c. 0000101010100000
Answer and Explanation:
Using JavaScript:
/* program should take N input which represents the dollar amount and output how many chocolate bars and how many coupons we have*/
function chocolatebar(dollars){
var dollaramt= dollars;
var i;
for(i=0; i <= dollaramt; i++){
i=i+6
?
Alert ("you have 1 extra chocolate bar");
:
Alert ("keep buying chocolate bars to get more coupons for a bonus chocolate bar")
}
}
*
Answer:
Explanation:
Part a)
_______________ ____________ _____________ ___
TAR | /\ \/ /\ \/ /\
|//////////|____________|____________|_____________|__________|
0 600 800 600 800 600
PWM Duty Cycle = 200/800 = 25%
Part b)
______________ _________________ _________ _________________
TAR | \/ /\ \/ /\ \/
|//////////|_________|_________________|__________| _______________|
0 600 800 600 800 600
PWM Duty Cycle = 600/800 = 75%
There’s 3 main ones accelerometer, gyroscope, and magnetometer.
Answer:
4 bits are required. 4 bits can represent 16 different values (2*2*2*2 or ). 3 bits can only represent 8 different values. In the general case n bits can represent values, or correspondingly m values can be represented by bits.