1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Any computer / electrical engineers around here?

Discussion in 'BlackHat Lounge' started by bk071, Nov 25, 2015.

  1. bk071

    bk071 Jr. Executive VIP Jr. VIP

    Joined:
    Nov 24, 2010
    Messages:
    3,223
    Likes Received:
    8,005
    I know its a LONG shot but hell I'll give it a try... I need help with an assignment. Let me know if you can help. I'll even pay if you don't feel like doing it for free.

    Here's what I need help with:

    [​IMG]

    Let me know if it makes any sense.
     
    • Thanks Thanks x 2
    Last edited: Nov 25, 2015
  2. Sherbert Hoover

    Sherbert Hoover Jr. Executive VIP Jr. VIP

    Joined:
    Dec 26, 2010
    Messages:
    997
    Likes Received:
    8,045
    Occupation:
    ORM - Branding - Content
    Location:
    United States
    Home Page:
    Q1: If a branch outcome is to be determined earlier, then the branch must be able to read its operand equally early. Branch direction is controlled by a register value that may either be loaded or computed. If the branch register value comparison is performed in the EX stage, then forwarding can deliver a computed value produced by the immediately preceding instruction if that instruction needs only one cycle in EX. There is no data hazard stall for this case. Forwarding can deliver a loaded value without a data hazard stall if the load can perform memory access in a single cycle and if at least one instruction separates it from the branch.

    If now the branch compare is done in the ID stage, the two forwarding cases just discussed will each result in one data hazard stall cycle because the branch will need its operand one cycle before it exists in the pipeline. Often, instructions can be scheduled so that there are more instructions between the one producing the value and the dependent branch. With enough separation there is no data hazard stall.

    So, resolving branches early reduces the control hazard stalls in a pipeline. However, without a sucient combination of forwarding and scheduling, the savings in control hazard stalls will be offset by an increase in data hazard stalls.

    EDIT: Just a heads up, that source is Google. Tread lightly.
     
    • Thanks Thanks x 1
    Last edited: Nov 25, 2015
  3. bk071

    bk071 Jr. Executive VIP Jr. VIP

    Joined:
    Nov 24, 2010
    Messages:
    3,223
    Likes Received:
    8,005
    Awesome. Thanks man. Any idea about the other two?
     
  4. davids355

    davids355 Jr. VIP Jr. VIP

    Joined:
    Apr 25, 2011
    Messages:
    9,833
    Likes Received:
    7,440
    Home Page:
    I would have happily helped you out for free but this has gone way over my head :)
     
  5. bk071

    bk071 Jr. Executive VIP Jr. VIP

    Joined:
    Nov 24, 2010
    Messages:
    3,223
    Likes Received:
    8,005
    Thanks David, I know you would have. :)
    Its a bit over my head too, that's why I asked for help from my BHW bros xD
     
  6. sockpuppet

    sockpuppet Junior Member

    Joined:
    Nov 7, 2011
    Messages:
    155
    Likes Received:
    145
    here my try on Q2:

    got that image from google the red ones are my changes, as you can see on my awesome multiplexer
    [​IMG]

    my necessary assumptions:
    -the ALU has a comparison op witch sets neg and zero flag
    -the instruction uses the r format

    controls
    RegDst: 1
    Branch: X
    MemRead: X
    MemtoReg: X
    ALUOp: code for compare, don't know
    MemWrite: X
    ALUSrc: 0
    RegWrite: 1
    My Additional Control Flag: 0 (needs to be set 1 for all other stuff)

    what this does
    -op2 == register1
    -op3 == register2
    -set the ALU to compare, which sets neg and zero flag
    -the third red (from left to right) multiplexer selects the op2 or op3 based on the neg flag
    -the second one selects either 0 or the result from the third based on the zero flag
    -the first one selects between the compare result and the result from the Data memory

    and that will work with all the other formats as long as you set the red control flag to 1


    Q3:
    Code:
     F | ID | EX | MEM | WB
     1
     2   1 
     3   2     1
     4   3     2    1
     5   4     3    2     1
    
    instruction 1 is on write back: write R1
    instruction 4 is on instruction decode/fetch register: read R11, R12
     
    • Thanks Thanks x 1
  7. Leith

    Leith Jr. Executive VIP Jr. VIP

    Joined:
    Oct 30, 2011
    Messages:
    5,682
    Likes Received:
    9,053
    [​IMG]
     
    • Thanks Thanks x 2
  8. SeoWrecker

    SeoWrecker Jr. VIP Jr. VIP

    Joined:
    Jul 16, 2012
    Messages:
    1,916
    Likes Received:
    1,644
    Gender:
    Male
    Location:
    Doesn't matter

    Exactly !
    you beat me to it by like 10 seconds.
     
    • Thanks Thanks x 2
  9. bk071

    bk071 Jr. Executive VIP Jr. VIP

    Joined:
    Nov 24, 2010
    Messages:
    3,223
    Likes Received:
    8,005
    You're a freaking star, mate.
    I'm software oriented guy so pretty much a noob when it comes to hardware side of things.
    Oh and awesome MUXes by the way.

    Thanks again for the help ;)
     
  10. seogiantking

    seogiantking Power Member

    Joined:
    Sep 19, 2015
    Messages:
    587
    Likes Received:
    98
    Gender:
    Male
    Location:
    Canada
    Home Page:
    It's way too high for me.