registers & counters

Download Registers & Counters

Post on 22-Feb-2016

65 views

Category:

Documents

0 download

Embed Size (px)

DESCRIPTION

Registers & Counters. Mantıksal Tasarım – BBM231 M. Önder Efe onderefe@cs.hacettepe.edu.tr. Registers. Registers are clocked sequential circuits A register is a group of flip-flops Each flip-flop capable of storing one bit of information An n-bit register consists of n flip-flops - PowerPoint PPT Presentation

TRANSCRIPT

Registers & Counters

1Registers & CountersMantksal Tasarm BBM231M. nder Efeonderefe@cs.hacettepe.edu.tr2RegistersRegisters are clocked sequential circuitsA register is a group of flip-flopsEach flip-flop capable of storing one bit of informationAn n-bit register consists of n flip-flopscapable of storing n bits of informationbesides flip-flops, a register usually contains combinational logic to perform some simple tasksIn summaryflip-flops to hold informationcombinational logic to control the state transition3CountersA counter is essentially a register that goes through a predetermined sequence of statesCounting sequenceRegisterFF0FF1FFn-1Combinational logic4Uses of Registers and CountersRegisters are useful for storing and manipulating informationinternal registers in microprocessors to manipulate data Counters are extensively used in control logicPC (program counter) in microprocessors54-bit RegisterREGQ3Q2Q1Q0D3D2D1D0clearDQclockCRDQCRDQCRDQCRclearD0D1D2D3Q0Q1Q2Q3FD16CE1616D[15:0]Q[15:0]CECCLRVerilog Code of FD16CEalways @ (posedge C or posedge CLR)beginif (CLR)Q