{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 11 - Sequential Logic Systems"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 11_1 Page No. 338"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tsu= 2.00e-08  seconds\n",
      "tpd= 3.00e-08  seconds\n",
      "Tmin=tpd+tsu= 5.00e-08  seconds\n",
      "fCkmax=1/Tmin = 2.00e+07  Hz\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division  \n",
    "tsu=20*10**(-9)\n",
    "print \"tsu= %0.2e\"%(tsu),\" seconds\" # Input set-up time of second flip flop\n",
    "tpd=30*10**(-9)\n",
    "print \"tpd= %0.2e\"%(tpd),\" seconds\" # Input set-up time of first flip flop\n",
    "Tmin=tpd+tsu\n",
    "print \"Tmin=tpd+tsu= %0.2e\"%(Tmin),\" seconds\" # Minimum allowed time interval b/w threshold levels of two consecutive triggering clock edges activating two flip-flops\n",
    "fCkmax=1/Tmin #  formulae  \n",
    "print \"fCkmax=1/Tmin = %0.2e\"%(fCkmax),\" Hz\"# Maximum clock frequency at which flip-flop can operate reliably"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 11_4 Page No. 338"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "tphL= 4.00e-08  seconds\n",
      "n= 3.00\n",
      "fmax=1/(n*tphL) = 8.33e+06  Hz\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division  \n",
    "tphL=40*10**(-9)\n",
    "print \"tphL= %0.2e\"%(tphL),\" seconds\" # Time taken from Clear to output\n",
    "n=3\n",
    "print \"n= %0.2f\"%(n) # Number of bits in counter i.e no. of flip-flops used\n",
    "fmax=1/(n*tphL) # Using formulae fmax<= 1/(n*tphL)\n",
    "print \"fmax=1/(n*tphL) = %0.2e\"%(fmax),\" Hz\"# Maximum counting rate at which flip-flop can operate reliably"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 11_6 Page No. 340"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "fs= 2000.00  Hz\n",
      "fB= 1000000.00  Hz\n",
      "part(i)\n",
      "fb= fB/(10**5)=10.00  Hz\n",
      "delta_t=1/fb= 0.10  seconds\n",
      "fs*delta_t= 200.00\n",
      "Display indication=0200\n",
      "part(ii)\n",
      "fb=fB/(10**3)= 1000.00  Hz\n",
      "delta_t=1/fb= 0.00  seconds\n",
      "fs*delta_t= 2.00\n",
      "Display indication=0002\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division  \n",
    "fs=2*10**(3) \n",
    "print \"fs= %0.2f\"%(fs),\" Hz\"# sine wave input signal frequency\n",
    "fB=1*10**(6)\n",
    "print \"fB= %0.2f\"%(fB),\" Hz\"# input Time-Base clock frequency\n",
    "\n",
    "print \"part(i)\"# part(i)of question\n",
    "fb=fB/(10**5)\n",
    "print \"fb= fB/(10**5)=%0.2f\"%(fb),\" Hz\"#  Time-Base frequency for 5 decade counter\n",
    "delta_t=1/fb\n",
    "print \"delta_t=1/fb= %0.2f\"%(delta_t),\" seconds\" # Gate Time interval\n",
    "DISP1=fs*delta_t\n",
    "print \"fs*delta_t= %0.2f\"%(DISP1)# Display indication for 5 decade counter\n",
    "print \"Display indication=0200\"# Display indication as 4-bit\n",
    "\n",
    "print \"part(ii)\"# part(ii)of question\n",
    "fb=fB/(10**3)\n",
    "print \"fb=fB/(10**3)= %0.2f\"%(fb),\" Hz\"#  Time-Base frequency for 3 decade counter\n",
    "delta_t=1/fb\n",
    "print \"delta_t=1/fb= %0.2f\"%(delta_t),\" seconds\" # Gate Time interval for 3 decade counter\n",
    "DISP2=fs*delta_t\n",
    "print \"fs*delta_t= %0.2f\"%(DISP2)# Display indication for 3 decade counter\n",
    "print \"Display indication=0002\"# Display indication as 4-bit"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}