[ECE] Logic Gates and Programming Background

Before

在数字电路中,我们通常使用两个电平来表示信息:高电平和低电平。

  • 高电平(1): 代表电压较高的状态。可以将其视为一种信号或状态,表示某种条件成立或某个设备处于活跃状态。

  • 低电平(0): 代表电压较低的状态。可以将其视为另一种信号或状态,表示某种条件不成立或某个设备处于非活跃状态。

有效状态 意味着这个状态是真实和被认可的状态,而不仅仅是一个电压变化。在数字电路中,一个输出端的有效状态取决于设计,有时被称为 "活动状态" 或 "被激活状态"。

  • Active-High 或 Asserted-High: 有效状态是高电平。例如,当开关按下时,输出可能是高电平,表示开关被激活。

  • Active-Low 或 Asserted-Low: 有效状态是低电平。例如,当按钮按下时,输出可能是低电平,表示按钮被激活。

Logic gates in applications:

Logic gates are fundamental building blocks used in digital circuits to perform various operations, such as arithmetic, memory storage, and decision-making.

Logic symbols used to represent the logic gates are in accordance with ANSI/IEEE Standard 91-1984/ Std. 91a-1991.
 

3–1 The Inverter

Inverter (NOT gate): The inverter, also known as a NOT gate, performs the operation of complementing or negating the input signal. If the input is high, the output is low, and vice versa.

The inverter (NOT circuit) performs the operation called inversion or complementation. The inverter changes one logic level to the opposite level. In terms of bits, it changes a 1 to a 0 and a 0 to a 1.

The Negation and Polarity Indicators

在数字电路的上下文中,"Negation Indicator" 和 "Polarity Indicator" 这两个术语通常是指同一样东西,即表示逻辑信号取反(反相)的标志。

当我们说 "Negation Indicator" 时,我们是指用于表示逻辑反相的符号或标志。这通常是一个小圆圈或一个小泡泡,置于信号线上,表示与正常逻辑相反的状态。

当我们说 "Polarity Indicator" 时,我们是指信号的极性或方向。正常逻辑状态被称为 "正极性"(Positive Polarity),而经过反相的状态被称为 "负极性"(Negative Polarity)

电平转换: 反相器用于进行电平转换。例如,将一个 active-HIGH 信号通过反相器,可以得到其 active-LOW 版本,反之亦然。这对于匹配不同部分之间的信号电平非常有用。

Standard logic symbols for the inverter are shown in Figure 3–1. Part (a) shows the distinctive shape symbols, and part (b) shows the rectangular outline symbols.

[ECE] Logic Gates and Programming Background_第1张图片

The negation indicator is a “bubble” ( o) that indicates inversion or complementation when it appears on the input or output of any logic element

The polarity or level indicator is a “triangle” ( △) that indicates inversion when it appears on the input or output of a logic element.

When appearing on the input, the bubble means that a 0 is the active or asserted input state, and the input is called an active-LOW input.

When appearing on the output, the bubble means that a 0 is the active or asserted output state, and the output is called an active-LOW output.

The absence of a bubble on the input or output means that a 1 is the active or asserted state, and in this case, the input or output is called active-HIGH.

a truth table is like this:

[ECE] Logic Gates and Programming Background_第2张图片

3–2 The AND Gate

AND gate: The AND gate takes two or more input signals and produces a high output only if all the inputs are high. Otherwise, the output is low.

The term gate was introduced in Chapter 1 and is used to describe a circuit that performs a basic logic operation. The AND gate is composed of two or more inputs and a single output, as indicated by the standard logic symbols shown in Figure 3–8. Inputs are on the left, and the output is on the right in each symbol. Gates with two inputs are shown; however, an AND gate can have any number of inputs greater than one. 左竖直,右半圆[ECE] Logic Gates and Programming Background_第3张图片

3–3 The OR Gate

OR gate: The OR gate takes two or more input signals and produces a high output if at least one of the inputs is high. The output is low only if all inputs are low.

An OR gate has two or more inputs and one output, as indicated by the standard logic symbols in Figure 3–18, where OR gates with two inputs are illustrated. An OR gate can have any number of inputs greater than one. 左内圆,右边圆尖。

The logical OR function of two variables is represented mathematically by a + between the two variables, for example, A + B. The plus sign is read as “OR.” Addition in Boolean algebra involves variables whose values are either binary 1 or binary 0. The basic rules for Boolean addition are as follows

Boolean addition is the same as the OR function. Notice that Boolean addition differs from binary addition in the case where two 1s are added. There is no carry in Boolean addition。

[ECE] Logic Gates and Programming Background_第4张图片

3–4 The NAND Gate

NAND gate: The NAND gate is a combination of an AND gate followed by a NOT gate. It produces a low output only if all inputs are high; otherwise, the output is high.[ECE] Logic Gates and Programming Background_第5张图片

3–5 The NOR Gate

The NOR gate is a combination of an OR gate followed by a NOT gate. It produces a low output only if at least one input is high; otherwise, the output is high.

[ECE] Logic Gates and Programming Background_第6张图片

3–6 The Exclusive-OR and Exclusive-NOR Gates

  1. Exclusive-OR (XOR) gate: The XOR gate produces a high output when the number of high inputs is odd.

[ECE] Logic Gates and Programming Background_第7张图片

  1. Exclusive-NOR (XNOR) gate: The XNOR gate produces a high output when the number of high inputs is even.

[ECE] Logic Gates and Programming Background_第8张图片

3–7 Programmable Logic

Concept of a Programmable AND Array:

A Programmable AND Array is a component found in Programmable Logic Devices (PLDs) such as Complex Programmable Logic Devices (CPLDs) or Field-Programmable Gate Arrays (FPGAs). It is a key part of the configurable logic within these devices. The AND array allows users to create custom logic functions by programming the connections between AND gates and other elements in the device.

The structure typically consists of an array of AND gates where the inputs and outputs can be programmatically interconnected to create different logic functions. This flexibility allows designers to implement a wide range of digital circuits by configuring the interconnections in a way that suits the specific application.

Programmable logic: Basic concepts involve using programmable devices like CPLDs (Complex Programmable Logic Devices) and FPGAs (Field-Programmable Gate Arrays) to implement digital circuits.

Fuse Technology

This was the original programmable link technology. It is still used in some SPLDs. The fuse is a metal link that connects a row and a column in the interconnection matrix. Before programming, there is a fused connection at each intersection. To program a device, the selected fuses are opened by passing a current through them sufficient to “blow” the fuse and break the connection. The intact fuses remain and provide a connection between the rows and columns. The fuse link is illustrated in Figure 3–51. Programmable logic devices that use fuse technology are one-time programmable (OTP).

原始的可编程连接技术是使用保险丝(fuse)的。在一些简单可编程逻辑器件(SPLD)中仍在使用。这个保险丝实际上是一条金属连接,连接着矩阵中的一行和一列。在进行编程之前,每个交叉点都有一条已经烧断的保险丝连接。

为了对设备进行编程,选定的保险丝通过传递足够的电流进行烧断,使其“断开”连接。没有被烧断的保险丝保持完好,提供行和列之间的连接。图3–51中展示了这种保险丝连接的情况。使用保险丝技术的可编程逻辑器件是一次性可编程(OTP)的,也就是说,编程一次后通常无法再次修改。

Antifuse Technology

An antifuse programmable link is the opposite of a fuse link. Instead of breaking the connection, a connection is made during programming. An antifuse starts out as an open circuit

whereas the fuse starts out as a short circuit. Before programming, there are no connections between the rows and columns in the interconnection matrix. An antifuse is basically two conductors separated by an insulator. To program a device with antifuse technology, a programmer tool applies a sufficient voltage across selected antifuses to break down the insulation between the two conductive materials, causing the insulator to become a lowresistance link. The antifuse link is illustrated in Figure 3–52. An antifuse device is also a one-time programmable (OTP) device.

反保险丝技术是一种与保险丝相反的可编程连接技术。它不是断开连接,而是在编程过程中建立连接。一个反保险丝在编程前是一个断路器,而一个保险丝在编程前是一个短路器。在进行编程之前,在连接矩阵的行和列之间没有连接。一个反保险丝基本上是由绝缘体隔开的两个导体。使用反保险丝技术对设备进行编程时,编程工具在选择的反保险丝上施加足够的电压,以击穿两个导体之间的绝缘体,使绝缘体变成低阻连接。反保险丝连接在图3–52中有图示。一个使用反保险丝技术的设备也是一次性可编程(OTP)的设备,也就是说,编程一次后通常无法再次修改。

Various Process Technologies for Programming a PLD:

There are different methods to program PLDs based on the technology used. Some common methods include:

  • EPROM (Erasable Programmable Read-Only Memory):

  • Older PLDs were often programmed using EPROM technology. The device could be programmed once, and the programming was non-volatile, meaning it would retain the configuration even when power was turned off.

  • 在某些可编程逻辑器件中,可编程连接类似于EPROM(电可编程只读存储器)中的存储单元。这种类型的可编程逻辑器件使用一种称为设备编程器的特殊工具进行编程。将设备插入编程器中,编程器连接到运行编程软件的计算机上。大多数基于EPROM的可编程逻辑器件是一次性可编程(OTP)。然而,带有窗口封装的器件可以通过紫外线(UV)光擦除并使用标准的可编程逻辑器件编程装置重新编程。

    EPROM工艺技术使用一种特殊类型的MOS晶体管,称为浮栅晶体管,作为可编程连接。浮栅器件利用一种称为Fowler-Nordheim隧道效应的过程将电子放置在浮栅结构中。在可编程AND阵列中,浮栅晶体管充当开关,将行线连接到高电平或低电平,具体取决于输入变量。对于未使用的输入变量,晶体管被编程为永久关闭。图3–53展示了一个简单阵列中的一个AND门。变量A控制第一列中晶体管的状态,变量B控制第三列中的晶体管。当晶体管关闭时,就像一个打开的开关一样,AND门的输入线处于+V(高电平)。当晶体管打开时,就像一个闭合的开关一样,输入线连接到地(低电平)。当变量A或B为0(低电平)时,晶体管打开,保持AND门的输入线为低电平。当A或B为1(高电平)时,晶体管关闭,保持AND门的输入线为高电平。

  • EEPROM (Electrically Erasable Programmable Read-Only Memory):

  • Similar to EPROM, but EEPROM technology allows for reprogramming of the PLD. The configuration can be electrically erased and reprogrammed.

  • 电可擦可编程只读存储器技术类似于EPROM,因为它同样使用E2 CMOS单元中的一种浮栅晶体管。不同之处在于EEPROM可以在不需要紫外线光或特殊设备的情况下进行电擦除和重新编程。在E2 CMOS器件安装在印刷电路板(PCB)上后可以进行编程,许多设备在系统运行时也可以重新编程。这被称为系统内编程(ISP)。图3–53也可以用作使用EEPROM技术表示的AND阵列的示例。

  • Flash Memory: Flash-based PLDs combine the advantages of EEPROM and faster programming times. They offer reprogrammability and non-volatility.

  • Flash技术基于单晶体管连接,既是非易失性的又可重新编程。Flash元素是一种EEPROM,但比标准EEPROM连接更快,产生更高密度的设备。

  • SRAM-Based Configuration: In SRAM-based PLDs like FPGAs, the configuration is stored in static RAM cells. Configuration data needs to be loaded into these cells every time the device powers up.

  • 许多可编程门阵列(FPGA)和一些复杂可编程逻辑器件(CPLD)使用类似于静态随机存取存储器(SRAM)的工艺技术。SRAM型可编程逻辑阵列的基本概念如图3–54(a)所示。一个SRAM型内存单元用于控制一个晶体管的开关,从而连接或断开行和列。例如,当内存单元包含1时(绿色),晶体管打开并连接相关的行和列线,如图(b)所示。当内存单元包含0时(蓝色),晶体管关闭,因此行和列之间没有连接,如图(c)所示。

  • Device Programming

  1. 编程方式: 不同的可编程器件(SPLD、CPLD、FPGA)基本上都是用相同的方式进行编程的。一些一次性可编程(OTP)的设备需要使用特殊的编程器,而EEPROM、Flash和SRAM等可重新编程的设备通常可以在开发板上进行编程。

  2. 编程器的使用: 编程器是一种特殊的硬件设备,通过标准电缆连接到计算机。在计算机上安装开发软件,将目标设备插入编程器插座中。

  3. 多次重新配置: EEPROM、Flash和SRAM等可重新编程的设备可以多次重新配置,这意味着你可以在设计过程中进行多次修改和测试。

  4. 开发板的使用: 初步的编程通常在PLD开发板上进行。这样可以更灵活地进行逻辑设计,因为你可以通过重新编程PLD来进行任何必要的更改。

设计输入: 设计输入是将逻辑设计编程到开发软件中,我们可以通过文本输入或图形(原理图)输入两种主要方式进行。大多数可编程逻辑器件制造商提供的软件包支持这两种方法。

  • 文本输入: 在大多数开发软件中,无论制造商如何,文本输入都支持两种或更多的硬件开发语言(HDLs)。例如,所有软件包都支持IEEE标准的HDLs,即VHDL和Verilog。有些软件包还支持一些专有语言,如AHDL。

  • 图形(原理图)输入: 在图形输入中,逻辑符号如AND门和OR门被放置在屏幕上,并相互连接以形成所需的电路。在这种方法中,你使用熟悉的逻辑符号,但软件实际上将每个符号和连接转换为计算机使用的文本文件;这个过程你看不到。图3–56展示了AND门的文本输入屏幕和图形输入屏幕的简单示例。一般来说,图形输入用于较不复杂的逻辑电路,而文本输入,尽管也可以用于非常简单的逻辑,但通常用于更大、更复杂的实现。

系统内编程(ISP): 某些CPLD和FPGA可以在安装在系统印刷电路板(PCB)上后进行编程。在开发板上开发并完全测试了逻辑设计后,它可以被编程到已经焊接在系统板上的“空白”设备中。此外,如果需要进行设计更改,可以重新配置系统板上的设备以包含设计修改。

在生产情况下,对系统板上的设备进行编程最小化了处理,并消除了需要保留预先编程设备的需求。这也排除了在产品中放置错误零件的可能性。未编程(空白)设备可以存放在仓库中,根据需要在现场编程。这最小化了企业需要用于库存的资本,并提升了产品的质量。

        

TAG: JTAG是Joint Test Action Group制定的标准的通用名称,即IEEE Std. 1149.1。JTAG标准的制定旨在提供一种简单的方法,称为边界扫描,用于测试可编程设备的功能以及测试电路板的连接质量,包括短路引脚、断路引脚、不良走线等。此外,JTAG已被用作在系统中配置可编程设备的一种便捷方式。随着对可现场升级产品的需求增加,使用JTAG重新编程CPLD和FPGA的便捷性也增加。

JTAG兼容的设备具有专用硬件,用于解释由四个专用信号提供的指令和数据。这些信号由JTAG标准定义为TDI(测试数据输入)、TDO(测试数据输出)、TMS(测试模式选择)和TCK(测试时钟)。专用的JTAG硬件解释TDI和TMS信号上的指令和数据,并在TDO信号上输出数据。TCK信号用于时钟过程。图3–57中展示了一个符合JTAG标准的PLD。

嵌入式处理器的系统内编程:

  • 什么是嵌入式处理器?

    • 是一种微处理器嵌入在系统内,与CPLD或FPGA一起工作,专用于在系统内配置可编程设备。
  • 为什么使用嵌入式处理器?

    • SRAM-based设备在断电时会失去编程数据,因此需要PROM来存储编程数据。嵌入式处理器负责将存储在PROM中的数据传输到CPLD或FPGA。
  • 系统运行时的重新配置:

    • 使用嵌入式处理器在系统运行时重新配置可编程设备。通过软件进行设计更改,然后将新数据加载到PROM中,而不干扰系统操作。处理器在适当的时候“即时”控制数据传输到设备。
  1. 文本输入像写字:

    • 比喻: 就像我们写文章时一个个字母组成单词,文本输入就像通过逐步书写代码,将逻辑设计组织起来。
    • 对比: 这就像你亲手写一封信,每个字母都是精心选择的,但可能在写的过程中需要更多的耐心和细致。
  2. 图形输入像搭积木:

    • 比喻: 图形输入就像在屏幕上搭建积木,将逻辑符号放在一起,通过连接形成我们想要的电路。
    • 对比: 这就像在搭积木一样,直观而且更适合简单的逻辑设计,但对于更大更复杂的设计,可能需要更多的空间和布局的考虑。
  3. 系统内编程像给机器下命令:

    • 比喻: 使用嵌入式处理器进行系统内编程就像给机器下命令,告诉它在运行时如何重新配置自己。
    • 对比: 这就像你告诉机器执行某个任务,机器会根据你的指令灵活地进行重新配置,就像在操作过程中即时调整。
  4. JTAG就像设备的体检:

    • 比喻: JTAG就像对设备进行体检,通过一种边界扫描的方式,检查设备的功能以及电路板的连接质量。
    • 对比: 这就像给设备进行一次全面的检查,可以发现可能存在的问题,同时也可以作为方便的方式来重新配置可编程设备。
  5. 嵌入式处理器的系统内编程比喻:

    比喻: 就好比你的房子里有一个魔法工匠,专门负责调整和重塑你的家具,确保它们在不同场合都能发挥最佳性能。解释: 这个嵌入式处理器就像一个专业的工匠,与你的家具(CPLD或FPGA)一起工作,负责在系统内调整配置,以确保它们在不同情境下都能够最好地发挥作用。而且,这位工匠能够在你正常使用家具的同时进行修改,就像你在使用家具的时候魔法般地进行调整,而无需中断正常的使用。

Programming feature

硬件描述语言(HDLs)与软件编程语言不同,因为HDLs包括描述逻辑连接和特性的方法。HDL实现了硬件中的逻辑设计(PLD),而软件编程语言(如C或BASIC)则指导现有的硬件执行操作。
 

3–8 Fixed-Function Logic Gates

Fixed-function integrated circuit devices: Various ICs, such as 7400 series ICs, contain specific logic gates for different applications.

3–9 Troubleshooting

Troubleshooting with an oscilloscope: An oscilloscope helps in diagnosing issues with logic gates by visualizing the signals and identifying abnormalities such as opens and shorts.

IC technologies—CMOS and bipolar (TTL): CMOS (Complementary Metal-Oxide-Semiconductor) and bipolar (Transistor-Transistor Logic) are two major families of IC technologies with different characteristics.

Propagation delay, power dissipation, speed-power product, and fan-out: These parameters are essential in analyzing the performance and reliability of logic gates in a circuit.

你可能感兴趣的:(ECE,ECE)