Program counter
The program was stored in memory with the first instruction at binary address 0000, and the second instruction at address 0001, The third at address 0010 and so on. The program counter, which are part of the control unit, counts from 0000 to 1111. Its job was to send the memory the address of next instruction.
The program counter are reset to 0000 before computer run. When the computer run begins, the program counter sends address 0000 to the memory. The program counter are then incremented to get 0001. After the first instruction are fetched and executed, the program counter sends address 0001 to the memory. Again The program counter is incremented. After the second isntruction are fetched and executed, the program counter sends address 0010 to the memory. In this-this-is-keeping track of the next instruction-to-be fetched and executed. Counter
The program counter are like someone pointing at a list of instruction, saying does this first, does this second, etc. The counter is sometimes called a pointer; It points to a address in memory where something important is being stored.
1 LibraryIEEE;2 Useieee.std_logic_1164. All;3 Useieee.std_logic_unsigned. All;4 5 EntityPc is6 Port 7 ( 8Ep:inch Std_logic;--! Active high output enable from PC, or tri-state9Clr:inch Std_logic;--! Active High Asynchronous clearTenClass:inch Std_logic;--! Falling Edge Clock OneCp:inch Std_logic;--! Active high Enable PC to count AQ: out Std_logic_vector(3 Downto 0)--! 4-bit PC output - ); - EndPC; the - ArchitectureBeh ofPc is - - SignalCount:Std_logic_vector(3 Downto 0); + - begin + A Process(Clr,ep,cp,clk,count) at begin - ifCLR ='1' Then -Q <="0000"; -Count <="0000"; -elsif CP ='1' Then - if(CLK'event and CLK ='0') Then in ifCount <"1111" ThenCount <= Count +1; - ElseCount <="0000"; to End if; + End if; - End if; the * ifEP ='0' Then $Q <="ZZZZ";Panax Notoginseng Else -Q <=count; the End if; + A End Process; the + EndBeh
SAP Computer program counter