EE E4321. Fall 2019 Final ExaminationJava

Java Python Department of Electrical Engineering

Final Examination

EE E4321.  Fall, 2019

December 16, 2019

Time: 180 minutes

Total: 250 points

1.   Consider an inverter operating with a supply voltage of VDD  with logic  signals that  swing between ground and VDD.  Let VT  = 0.32 V for the nFET and -0.32 V for the pFET.  Let the above-threshold  drain  current  be  governed  by  the  equation  ID=WCoxvsat(VGS-VT),  where WCoxvsat = 1 mA/V, for the nFET and by the equation ID=WCoxvsat(VSG+VT), where WCoxvsat = 1 mA/V, for the pFET.  For the nFET, Ioff  is defined by VGS= 0.0 V and VDS  = VDD.  For the pFET, Ioff  is defined by VSG  = 0.0 V and VSD  = VDD.   For the nFET, Ion  is defined by VGS=VDD and VDS=VDD. For the pFET, Ion  is defined by VSG  = VDD and VSD = VDD.

(a) Let VDD  = 1.2 V.  If the current of the nFET (pFET) is 100 μA at VDS  (VSD) of VDD  at a VGS  (VSG) of 0.32 V, what is the off-current (Ioff)?    Assume a subthreshold slope of 90 mV/decade and ignore DIBL.  What is the Ion/Ioff ratio for each transistor?  (10 points)

(b) Now let VDD = 0.2 V.  What is the Ion/Ioff ratio for each transistor? (10 points)

(c) If this inverter drives a load of 10 fF, estimate the delay of this inverter at VDD  = 0.2 V. (10 points)

(d) If the inverter (with VDD  = 0.2 V) is stimulated with a 50%-duty-cycle square wave at its input switching between 0 and 0.2 V with a period of 1 nsec, what is the average power consumed by this inverter? (10 points)

2.          Consider short-channel effects.   Remember that device VT  is strongly affected by bulk

charge under the channel.

(a)        One typically finds that the magnitude of the threshold voltage of a short-channel device decreases with increasing VDS.  Why is this? (10 points)

(b)       Before  the  advent  of advanced  halo  doping  techniques,  one  found  that  circuits  with smaller channel lengths had threshold voltage of lower magnitude.  Why was this?  This is the effect we described in class as “VT rolloff.” (10 points)

(c)       Modern  device  technologies  have  introduced  halo  doping.      In  this  case,  the  region

directly under the source and drain is more heavily doped than the substrate as a whole.    This helps control the extent of the source and drain depletion regions.   The  case  of the nFET is shown below.  In the presence of halo doping, one generally finds an “inverse” rolloff in which smaller channel lengths lead to higher magnitude threshold voltages.  Why might this be? (10 points)

3.         Consider the  carry chain of the four-bit  static ripple carry adder shown below.   Cload models the loading of the sum circuit at each bit.  For this technology, transistors are assumed to provide  kgate   =   1  fF/μm  of  loading.    Assume  that  the  fanout-of-one  (FO1)  delay  for  this technology is τ1  = 25 psec.

(a)       If W = 1 μm, what is the delay of the carry chain from Cin  to Cout?  (10 points)

(b)       If VDD   =  1.2 V  and  W =  1  μm, what is the energy dissipated by a single propagated transition through the carry chain?  (10 points)

(c)       What  value  of W will  minimize the delay of this carry chain?   What  energy  will be dissipated at this value of W for a single transition through the chain?  (9 points)

(d)       Repeat the calculation of (c) if Cload  = 0. (10 points)

4.          Sketch the waveforms for scan_enable, clock, scan_in, and scan_out for a test sequence to scan in a test pattern, clock the system once, and scan out the resulting pattern such that a stuck-at-one fault at node X could be detected.   Show  where this would be  detecte EE E4321. Fall, 2019 Final ExaminationJava d in your waveform. (20 points)

5.          Consider the clock chopper circuit shown below.   The delay block (labelled ∆) can be implemented with an even number of inverters.

(a)        Consider  two  clock-chopped  flip-flops  separated  by  combinational  logic  as  shown below.  Assuming that the combinational logic represents a fixed delay of 200 psec and there is skew between CLK1 and CLK2 such that CLK2 arrives 100 psec earlier than CLK1, what is the maximum value ∆ (the pulse width of the chopped clock) can have and still ensure correct functionality?   Assume that the latches have a hold time of 50 psec on their closed clock edge. (10 points)

(b)       Assume that this chopped clock with the pulse width calculated in (a) is driven from an inverter with a load capacitance of 200 fF.     The inverter is sized 4 μm / 2 μm in a technology with a FO1 delay of τ1  = 25 psec.  Assume a gate capacitance of 2 fF/μm.  Sketch the waveform. of the clock as received by the latch.   What will be the “height” of the pulse?    What problems might this present? (12 points)

6.        Consider the following dynamic PLA structure.

(a)       We discussed in class how it is necessary to derive the clocks φAND   and φOR   in such a manner that the OR plane does not being to evaluate until after the AND plane has evaluated. Furthermore, both φAND  and φOR  must allow for adequate precharge time.    If the clocks satisfy this relationship, what is the logic function of this PLA (i. e, what are y0  and y1  as a function of x0, x1, and x2)? (10 points)

(b)       Design a replica AND row, two instance of which can be used in the circuits below to generate φAND  and φOR to meet the timing constraints described in (a). (8 points)

7.         Consider a long global wire from driver A to receivers B and C as shown below.  Assume that the wire is 0.4 mm wide and has a resistance of 0.076 O/square.   Its capacitance per unit length is given by:

Assume that each receiver has a load of 100 fF.

(a)        Explain why the capacitance has the functional form specified above. (8 points)

(b)       Calculate the Elmore delay from A to B. (10 points)

(c)       Assume the Elmore delay calculated in  (b).   If the FO1 delay of this technology is  50 psec, would resistance have to be considered for this line in calculating the delay from A to B? Explain. (8 points)

(d)       Now imagine widening the wire from A to X from 0.4 μm to 10 μm.  What is the Elmore delay now from A to B? (10 points)

8.         Consider the following path from a dynamic gate through two static gates.    Assume that the technology is characterized by a gate capacitance per unit width of 1 fF/μm.  Let the FO1 delay of this technology be τ1  = 25 psec.

(a)       Estimate   the   delay  form  A  rising  to  E  rising  in  the  evaluate  phase  (φ =   1)   if W1=W2=W3=W4=W5=W6= 1 μm.  Let Csidebranch  = 0. (10 points)

(b)       Keeping W1  fixed at  1 μm, resize the network to minimize the delay from A rising to E rising with Csidebranch  = 0. Please do not allow the beta ratio (ratio of pFET strength to nFET strength) for any gate become more than 4 or less than 0.25. (15 points)

(c)       Using the sizing of (b), what is the delay from A rising to E rising with Csidebranch  = 200 fF. (10 points)

9.          Joe Engineer is designing a simple pass-transistor latch as shown below.

He finds that he is unable to write the latch; that is, when clk is high, Y is not affected by the value of A         

基于 NSFW Model 色情图片识别鉴黄 后面更新视频检测 项目背景: 随着互联网的快速发展,网络上的信息量呈现出爆炸式的增长。然而,互联网上的内容良莠不齐,其中不乏一些不良信息,如色情、暴力等。这些信息对青少年的健康成长和社会风气产生了不良影响。为了净化网络环境,保护青少年免受不良信息的侵害,我国政府加大了对网络内容的监管力度。在此背景下,本项目应运而生,旨在实现对网络图片和视频的自动识别与过滤,助力构建清朗的网络空间。 项目简介: 本项目基于 NSFW(Not Safe For Work)Model,利用深度学习技术对色情图片进行识别与鉴黄。NSFW Model 是一种基于卷积神经网络(CNN)的图像识别模型,通过学习大量的色情图片和非色情图片,能够准确地判断一张图片是否含有色情内容。本项目在 NSFW Model 的基础上,进一步优化了模型结构,提高了识别的准确率和效率。 项目功能: 色情图片识别:用户上传图片后,系统会自动调用 NSFW Model 对图片进行识别,判断图片是否含有色情内容。如果含有色情内容,系统会给出相应的提示,并阻止图片的传播。 视频检测:针对网络视频,本项目采用帧提取技术,将视频分解为一帧帧图片,然后使用 NSFW Model 对这些图片进行识别。如果检测到含有色情内容的图片,系统会给出相应的提示,并阻止视频的传播。 实时监控:本项目可应用于网络直播、短视频平台等场景,实时监控画面内容,一旦检测到含有色情内容的画面,立即进行屏蔽处理,确保网络环境的纯洁。
### 如何在本地部署 NSFW 模型或服务 要在本地环境中成功部署 NSFW(不适宜工作场合内容)检测模型或服务,以下是详细的说明: #### 准备环境 为了确保能够顺利运行模型和服务,需要安装必要的依赖项。这些工具和库包括但不限于以下几类: - **Python 环境**: 推荐使用 Python 3.7 或更高版本。 - **Transformers 库**: 提供加载预训练模型的功能[^1]。 - **PyTorch/TensorFlow**: 支持深度学习框架的计算需求。 - **Pillow (PIL)**: 处理图像文件并将其转换为适合输入模型的形式。 具体命令如下所示: ```bash pip install transformers torch Pillow ``` #### 加载模型与测试 通过 Hugging Face 的 `transformers` 工具包可以直接访问已有的 NSFW 图片分类模型。例如,可以采用名为 `"Falconsai/nsfw_image_detection"` 的公开模型来完成此任务[^1]。 下面是一个简单的代码片段展示如何加载该模型并对单张图片执行预测操作: ```python from PIL import Image from transformers import pipeline def classify_nsfw(image_path): # 打开指定路径下的图片文件 img = Image.open(image_path) # 初始化 image-classification 流水线对象,并指明使用的特定模型名称 classifier = pipeline("image-classification", model="Falconsai/nsfw_image_detection") # 对传入的图片调用流水线方法得到其类别标签及其置信度分数列表形式的结果 result = classifier(img) return result if __name__ == "__main__": test_img_path = "<your_test_image>" output_results = classify_nsfw(test_img_path) print(output_results) ``` 注意替换 `<your_test_image>` 成实际存在的图片绝对或者相对地址字符串值之前再尝试运行以上脚本。 #### 构建 RESTful API 服务 如果希望进一步扩展功能至 Web 应用程序层面,则可考虑利用 Flask/Django 这样的轻量级 web 开发框架构建起支持 HTTP 请求交互的服务端接口。这里给出基于 FastAPI 实现的一个简单例子作为示范用途: ```python import uvicorn from fastapi import FastAPI, File, UploadFile from PIL import Image from io import BytesIO from typing import List from pydantic import BaseModel app = FastAPI() class Prediction(BaseModel): label: str score: float @app.post("/predict/", response_model=List[Prediction]) async def predict(file: UploadFile = File(...)): try: contents = await file.read() pil_image = Image.open(BytesIO(contents)) clf_pipeline = pipeline('image-classification', model='Falconsai/nsfw_image_detection') predictions = clf_pipeline(pil_image) formatted_preds = [{"label": pred['label'], "score": round(pred['score'], 4)} for pred in predictions] return formatted_preds except Exception as e: raise ValueError(f"Error processing uploaded file {e}") if __name__ == '__main__': uvicorn.run(app, host='0.0.0.0', port=8000) ``` 启动服务器之后即可向 `/predict/` 路径发送 POST 请求附带上传待分析的目标图片获取返回结果了。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值