Brac University
Department of Electrical & Electronic Engineering
CSE161/EEE103/ECE103: Computer Programming
Assignment1, Section-3, Summer 2022
Total Marks: 20 Due Date: 31st July
Question 1: [20]
For the following NMOS transistor, 𝑉𝑡 = 1𝑉.
Figure 1: NMOS Transistor
Current 𝐼𝑑𝑠 as a function of 𝑉𝑑𝑠 can be calculated as,
𝟏
(𝑽𝒈𝒔 − 𝑽𝒕 )𝑽𝒅𝒔 − (𝑽𝒅𝒔 )𝟐 , 𝑽𝒅𝒔 < (𝑽𝒈𝒔 − 𝑽𝒕 )
𝟐
𝑰𝒅𝒔 (𝑽𝒅𝒔 ) = 𝟐
𝟏
{ 𝟐 (𝑽𝒈𝒔 − 𝑽𝒕 ) , 𝑽𝒅𝒔 ≥ (𝑽𝒈𝒔 − 𝑽𝒕 )
Write a C program to perform all the following task:
a) Calculate the value of 𝐼𝑑𝑠 and store in an array, for 𝑉𝑑𝑠 = 0,1,2, … 6 considering 𝑉𝑔𝑠 = 3.5
b) Calculate the value of 𝐼𝑑𝑠 and store in an array, for 𝑉𝑑𝑠 = 0,1,2, … 6 considering 𝑉𝑔𝑠 = 4
c) Print the values stored in array of (a) & (b) as specified below,
Sample output for (a) [**Values shown here do not represent the actual values]:
Considering Vgs=3.5
Vds=0 Ids=1 [14]
Vds=1 Ids=1.5
.
.
.
Vds=6 Ids=5.5
d) Plot the values obtained in (a) & (b) in the same figure using Desmos [6]