summaryrefslogtreecommitdiff
path: root/Integrated_Circuits_by_Dr._Sanjay_Sharma/Ch_14_1.ipynb
blob: 1b036c132e1d77aeaa372e6465e8ba0f3f67b263 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter : 14 - Phase-Locked Loops (PLL)"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.1 : Page No - 525\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import sqrt, pi\n",
      "#Given data\n",
      "R_T = 10 # in k ohm\n",
      "R_T = R_T * 10**3 # in ohm\n",
      "C_T = 0.005 # in \u00b5F\n",
      "C_T = C_T * 10**-6 # in F\n",
      "C=10*10**-6 # in F\n",
      "f_out = 0.25/(R_T*C_T) # in Hz\n",
      "print \"Free Running frequency =\",int(f_out*10**-3),\"kHz\" \n",
      "# Part (ii)\n",
      "V=20 # in V\n",
      "f_L= 8*f_out/V # in Hz\n",
      "print \"Lock range in kHz = \u00b1\",int(f_L*10**-3),\"kHz\"\n",
      "# Part (iii)\n",
      "f_C= sqrt(f_L/(2*pi*3.6*10**3*C)) # in Hz\n",
      "print \"Capture range = \u00b1\",int(f_C),\"Hz\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Free Running frequency = 5 kHz\n",
        "Lock range in kHz = \u00b1 2 kHz\n",
        "Capture range = \u00b1 94 Hz\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.2 : Page No - 532\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import log\n",
      "#Given data\n",
      "f_out_max = 200 # in kHz\n",
      "f_out_min = 4 # in Hz\n",
      "f_CLK = 2.2*f_out_max # in kHz\n",
      "print \"Frequency of reference oscillation = %0.f kHz\" %f_CLK \n",
      "f_CLK= f_CLK*10**3 # in Hz\n",
      "# Formula f_out_min= f_CLK/2**n\n",
      "n=log(f_CLK/f_out_min)/log(2) \n",
      "print \"The number of bits required in the phase accumulator = %0.f\" %round(n)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Frequency of reference oscillation = 440 kHz\n",
        "The number of bits required in the phase accumulator = 17\n"
       ]
      }
     ],
     "prompt_number": 6
    }
   ],
   "metadata": {}
  }
 ]
}