ALU with PC , need help

Thread Starter

abhimanyu143

Joined Aug 25, 2014
211
hello ,

I need help , A picture is worth a thousand words. so I am posting schematic. I hope someone will help me
upload_2015-1-8_5-48-39.png

blue - 10 bit address bus
black -4 bit data bus
red - I don't understand connection between pc and ALU?

I don't understand how how program counter know some the instruction (jump , branch , subroutine call )
I think mux is use for following
low address means - output of multiplexer should (0)
high address means - output of multiplexer should (1)
when address mux is ( 0) then this is end of instruction and pc incremented for next address
when address mux is (1) then execute jmp or branch instruction

I don't understand how does 10bit address load from 4 bit data bus ?
 

Thread Starter

abhimanyu143

Joined Aug 25, 2014
211
hello ,

I need help , A picture is worth a thousand words. so I am posting schematic. I hope someone will help me
View attachment 78379

blue - 10 bit address bus
black -4 bit data bus
red - I don't understand connection between pc and ALU?

I don't understand how how program counter know some the instruction (jump , branch , subroutine call )
I think mux is use for following
low address means - output of multiplexer should (0)
high address means - output of multiplexer should (1)
when address mux is ( 0) then this is end of instruction and pc incremented for next address
when address mux is (1) then execute jmp or branch instruction

I don't understand how does 10bit address load from 4 bit data bus ?
please help me , I really need help
 

alfacliff

Joined Dec 13, 2013
2,458
many circuit diagrams are drawn that way, if every line was from start to finish, the drawing for computers would be virtually unreadable. thats why four data lines are shown here and the other four are shown somewhere else.address lines are even worse, you have to watch carefully where they come from then wherew they go, the lines arent there between, but the adress lines will be marked so you can find the source and the destination.
 

Thread Starter

abhimanyu143

Joined Aug 25, 2014
211
you have to watch carefully where they come from then wherew they go, the lines arent there between, but the adress lines will be marked so you can find the source and the destination.
I don't understand the red bus connection that's why I am asking about connection ?
 

absf

Joined Dec 29, 2010
1,968
You'd have noticed that I have replaced your ACC 74HC194 (4 bit counter) with 74HC173 which is a (quad F/F with 3-state outputs) so the HC244 can be omitted. As I am not sure if the outputs of ALU is 3-state or not, i have put a 3-state buffer on the o/p of the ALU before entering the Data Bus.

Also there is a register call "Program Address Register" between the ROM and the Program Counter. I think that has to be added later. BTW this is a test : Why do you think you need to connect the output of ALU to the Data Bus?

8051 ARCH 2.PNG
The yellow parts are the ones that have been implemented. The green ones are the Data Bus and the blue is the Address Bus.

Allen
 
Last edited:

Thread Starter

abhimanyu143

Joined Aug 25, 2014
211
You'd have noticed that I have replaced your ACC 74HC194 (4 bit counter) with 74HC173 which is a (quad F/F with 3-state outputs) so the HC244 can be omitted. As I am not sure if the outputs of ALU is 3-state or not, i have put a 3-state buffer on the o/p of the ALU before entering the Data Bus.

Also there is a register call "Program Address Register" between the ROM and the Program Counter. I think that has to be added later. BTW this is a test : Why do you think you need to connect the output of ALU to the Data Bus?

View attachment 78512
The yellow parts are the ones that have been implemented. The green ones are the Data Bus and the blue is the Address Bus.

Allen
first of all , thank you for helping me
I want to ask some question related to your Program counter. could you give me idea How does your PC work. I mean how PC understand jump , branch , subroutine instruction ,
 

absf

Joined Dec 29, 2010
1,968
The PC doesn't know what is on the data bus and what instruction is being executed. That's the job of the Instruction decoder. Instruction decoder is like the heart of the CPU. But before we get to it, you have to complete the infra-structure first.

This cpu will not have interrupt handling, timers, bi-directional ports or external memories etc like we normally have in a mcu. Once the design is completed, we can add an 8 bit output and an 8 bit input port.

You have not answer my question on post #6.

Allen
 
Last edited:

Thread Starter

abhimanyu143

Joined Aug 25, 2014
211
. But before we get to it, you have to complete the infra-structure first.

Once the design is completed, we can add an 8 bit output and an 8 bit input port.


Allen
as you said , First I have to make design.
my answer
main component of MCU design
1. program memory (
2.data memory
3.instruction decoder
4.program counter
5. general purpose register
6. accumulator register
7. ALU
8. data pointer ( i need Ic for data pointer ?)
9.psw register (I need Ic for psw register ? )

Now I know top 7 component that mostly used in normal mcu design. I have already connected some component with each other in my previous thread. I am not confident that will make design correctly but I will try to make design.
Now I want to connect all component in one design. what do you think ? its enough to good start ? or I have to add some other components
 

Thread Starter

abhimanyu143

Joined Aug 25, 2014
211
But I am asking the question based on your 8051 design and I want you to tell in your own understanding why o/p of ALU is connected to the data bus. Dont tell me what I already know, tell me what do you understand from this connection...

Allen
I want to connect output of ALU to data bus, To tell the program counter that arithmatic and logic instruction has been executed .
there are different type of instructions, that execute in different .

processor can only execute one instruction at a time. It will not execute the next instruction until it finishes executing the current one. we just need to tell program counter that instruction has been executed

you just asked why do you want to connect output of ALU to data bus. I answered in few lines. tell me ,Its enough or I need to explain more.
 
Last edited:

absf

Joined Dec 29, 2010
1,968
No, from the architecture block diagram of 8051 on post #6, you can see that the O/P of ALU is connected to Accumulator, Temp1 and Temp2. These 3 registers are all on the data bus. That's why the op of ALU has to be connected to data bus. See the diagram from wikibooks...

PC_Simple.svg.png

Allen
 

Thaelin

Joined Feb 1, 2015
1
Hi abhimanyu143:
I embarked on the same journey that you are now in. It was a fascinating trip through how a computer works. In short, the answer to how does a computer understand what the jmp instruction means is done in the microcode roms. I see you have in your schematic one of those roms. Typically there would be two of them due to the 8 bit buss. If you have a 16 bit it may be two or four depending how it was built. Yours if say for a 4 bit system. The value in binary is loaded into a register and then clocked out to the support circuitry which causes the prescribed function.
I found on line a great tutorial of a 16 bit system designed and built by an individual just for the experience of it. It shows a completed circuit with micro-code and links to op-sys. I highly recommend you d/l and take the journey too. Look for the D-16, it is priceless.

thaelin
 
Top