This assignment is to be completed neatly and legibly, showing all

advertisement
EC312 Homework 1
Name: _____________________________
Section:____________________________
This assignment is to be completed neatly and legibly, showing all work.(Use a separate piece of paper
if necessary.) Note that questions 1-9 are review questions on number systems and C programming,
covering concepts that you should already know from SI110, ES200, and ES202. Helpful resources
include:
-
The SI110 website (http://www.usna.edu/CS/si110/lec/l01/lec.html)
The first three chapters of the EC310 online course notes
(http://www.usna.edu/ECE/ec310/ec310notesSpring2015.pdf)
The Hacking textbook
Note concerning variable types. For this course, we will use the following C variable types:
Type
Abbreviation
Description
# of bytes
Integer
int
Integer values (1, -5, 28493)
4
Float
float
Real numbers (2.35, -9.9)
4
Character
char
A single ASCII character (A,$,…)
1
Printf conversion specifier
%d
%f
%c
Questions:
1)
2)
3)
4)
5)
6)
7)
8)
Consider a quantity of 3072 bits. How many bytes does this amount to?
Express the binary number 01010100 as a decimal number. (Show all work.)
Convert the decimal number 78 to binary. (Show all work.)
Express the hexadecimal number 0xA7E as a decimal number. (Show all work.)
Convert the hexadecimal number 0x72C to binary. (Show all work.)
Convert the binary number 111100011001 to hexadecimal. (Show all work.)
How is the letter “g” stored in memory in binary? How is it stored in hexadecimal?
If the following variable declaration statements are included in a C program, how much space in
memory will the compiler set aside for these variables? (See note at the top of this assignment
regarding variable types.)
int tacos, chimichangas;
int nachos = 14;
float pico, de, gallo;
char tortilla, guacamole;
float burritos = 2;
9) Data is stored in main memory (RAM) at locations with addresses given in hexadecimal form. The
figure below shows nine consecutive locations in memory, and the address of the first item is
0x0804839C.
a. If the addresses are numbered sequentially, label the left-hand side of the figure showing the
addresses for the next eight memory locations. (You basically just have to count up in hex.)
b. Suppose you’re told that the items stored in the first five memory locations are characters.
Use your ASCII table to determine what is stored in this portion of memory.
10) What is the name given to the semiconductor device that has three or more elements? 11) What electronic function made the transistor famous? 12) In which direction does the arrow point on an NPN transistor? 13) To properly bias an NPN transistor, what polarity voltage is applied to the collector, and what is its
relationship to the base voltage? Also, draw the correct biasing in the pictures below as if you were applying voltages to the transistor:
14) Why is conduction through the forward-biased junction of an NPN transistor primarily in one
direction, namely from the emitter to base? 15) In the NPN transistor, what section is made very thin compared with the other two sections? 16) What percentage of current in an NPN transistor reaches the collector? 17) What is the letter designation for base current? 18) Name the two current loops in a transistor. 19) What is the relationship between the polarity of the voltage applied to the PNP transistor and that
applied to the NPN transistor? 
Download