| 
                        
                     | 
                    
                        
		
		12
		
		
		
			
				| 
					
	
	
	
	
				 | 
				
					
	
	 
		Hi there, I am a self-learner and since I am enjoying the book so much, I thought I'd drop in and check out the forums. 
  Many of my questions have already been answered in previous posts, so I want to say thanks to all the helpful people on here! My main interest is building actual real-life computers from 74xx series logic, and messing around with classic microprocessors like the 6502 and Z80, but this course has really opened my eyes to HDL and EDA, I never thought simulating circuits could be this fun. If anyone has any good software recommendations for logic design/simulation/testing or knows a good place to score old test equipment I'd love to hear from you. Thanks for reading this, and see ya later.
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	 Administrator 
	
	
	
				 | 
				
					
	
	
		If you haven't found it yet, check out  Logisim. It's a fairly powerful schematic-based digital circuit simulator. I've written a library of 7400 series TTL parts for it, and used them to simulate a Hack-like computer. Email me if you want the library.
 --Mark
  Here's what the CPU looks like using my library in Logisim. Note that the chip labeled "ALU2" is a the ALU, also implemented with TTL, but it's too big for a reasonable screen shot.
  
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	
	
	
	
				 | 
				
					
	
	 
		Thanks for the info, I have experimented with Logisim a bit, but haven't gotten the hang of it yet. I would love to check out that 7400 series library, I'll send you an email. Sorry for the late reply been a busy week, Thanks again and see ya later!
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	
	
	
	
				 | 
				
					
	
	 
		HI
 can you please send this file with TTL completed circuits please
 because i buy the components, and i can see good, how to connect the right wires
 Thanks
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	
	
	
	
				 | 
				
					
	
	 
		hello
 i try to build from the picture you in the site
 and i buy the material
 but i cant see good the connection of wire number
  please can you give the file
 thanks
 
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	 Administrator 
	
	
	
				 | 
				
					
	
	 
		Unfortunately that won't be possible, as that resource is no longer available.
  But you should be able to build up the schematics very easily from the HDL files once you have those written.
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	
	
	
	
				 | 
				
					
	
	
		Thanks for answer,
 but what to do now i buy all that material
 and i download some hack circuits in logisim
 but they use more components of other logic they use
 I DONT KNOW , what to do, i implement ALU in logisim, i see one video on you tube(  https://www.youtube.com/channel/UC0QN6YcvbMEDavdUX0k68yg), and it explain PERFECT
 BECAUSE
 i have a little difficult to understand HDL, do you have any ide where can i find tutorial
 like this one he  explain all hack cpu to impement
 and i dont know how to fit my material to implement the hack cpu, because i start last months to follow the course NAND2TETRIS, 
 THANKS man.
	
	
	
	  
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	 Administrator 
	
	
	
				 | 
				
					
	
	 
		You don't need to use Logisim or any other logic simulator other than the HDL simulator that is available from the course website. If you WANT to do that, then that is fine, but it also means you are on your own.
  The simplified HDL that is implemented by the Nand2Tetris project does have a couple non-intuitive aspects to it; I'll readily grant you that. But if you use the HDL Survival Guide you can get past those.
  Have you done Project 1 using the HDL and Hardware Simulator completely and successfully? If not, that's the first step.
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	
	
	
	
				 | 
				
					
	
	 
		H
 i understand and nor or xor, no16? and16 …...mux 16 etc
  but my problem is, i dont know to connect those to create hack cpu
 
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	 Administrator 
	
	
	
				 | 
				
					
	
	 
		You need to build up to the CPU. First you need to build (and understand) the circuits in Chapter 2 (the arithmetic circuits) and Chapter 3 (the sequential circuits). Then you need to understand how what operations the CPU needs to support by understanding the Hack assembly language. Only then are you in a position to tackle the CPU itself.
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	
	
	
	
				 | 
				
					
	
	 
		thank you , you are correct
 i gonna study more
  greetings.
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	
	
	
	
				 | 
				
					
	
	 
		can you help me please 
 i get from internet, the files i study and i test
 but this one CPU.HDL
  CHIP CPU {
      IN  inM[16],         // M value input  (M = contents of RAM[A])
         instruction[16], // Instruction for execution
         reset;           // Signals whether to re-start the current program
                          // (reset == 1) or continue executing the current
                          // program (reset == 0).
      OUT outM[16],        // M value output
         writeM,          // Write into M? 
         addressM[15],    // RAM address (of M)
         pc[15];          // ROM address (of next instruction)
      PARTS:
                 Ctrl(instr=instruction, aInst=aInst, val=newAVal, abit=abit, cbits=cbits, dest[0]=writeM, dest[1]=writeD, dest[2]=cwriteA, jump[2]=jlt, jump[1]=jeq, jump[0]=jgt);
                  
                 //Mux16(a=ALUResult, b[0..14]=newAVal, b[15]=false, sel=aInst, out=Ain);
                 
                 Or(a=aInst, b=cwriteA, out=writeA);
                 
                 //ARegister(in=Ain, load=writeA, out=aVal, out[0..14]=addressM);
                 //Mux16(a=aVal, b=inM, sel=abit, out=ALUInY);
                 //DRegister(in=ALUResult, load=writeD, out=ALUInX);
                 //ALU(x=ALUInX, y=ALUInY, zx=zx, nx=nx, zy=zy, ny=ny, f=f, no=no, out=ALUResult, out=outM, zr=zr, ng=ng);
                 //JmpCtrl(lt=jlt, eq=jeq, gt=jgt, zr=zr, ng=ng, jump=jump);
                 //PC(in=aVal, inc=true, load=jump, reset=reset, out=pco);
                 }
  if i have no comment, 
 i will get error line 2 = Mux16(a=ALUResult, b[0..14]=newAVal, b[15]=false, sel=aInst, out=Ain);
  i dont understant, Mux have 4 inputs??????
 thanks.
 
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	 Administrator 
	
	
	
				 | 
				
					
	
	 
		By "get from internet", do you mean that you found someone else that posted their solution instead of putting in the effort to come up with your own?
  If so, then you are defeating the purpose and making if very difficult for you to really learn as much as you could from the project.
  Why do you think Mux16 has 4 inputs?
  Have you built up the Mux16 in Project 1 and know what it does and how it works?
  What error are you getting? I'm not a mind reader. 
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	
	
	
	
				 | 
				
					
	
	 
		Hi
 normal mux is
  Mux(a=a, b=b, sel=sel, out=out);
 it sounds like if sel = 0 output = a, otherwise if sel = 1 output b
 is easy....
  but when i load cpu.hdl, he just say path +" cpu.hdl line 2"
 i really i have in mind to build the computer fast as it is,
 
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	
	
	
	
				 | 
				
					
	
	 
		mux16 is easy
 only i use array for example
 mux16(a[0..15], b[0..15], sel=sel[0..15], out=out[0..15])
  result the same like mux
  if if sel[1]= 1 and a[1]= out a[1] otherwise b[1];
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	 Administrator 
	
	
	
				 | 
				
					
	
	
		
michael1978 wrote 
mux16 is easy
 only i use array for example
 mux16(a[0..15], b[0..15], sel=sel[0..15], out=out[0..15])
  result the same like mux
  if if sel[1]= 1 and a[1]= out a[1] otherwise b[1];
 
 
 
This isn't the specification for the Mux16 given in the project. If you don't implement your parts so that they meet the specification, then you can't hope that anything that uses them will work like it's supposed to.
 The Mux16 has a single bit selection line -- not 16 bits.
 If the value of the 'sel' input is 0, then the 16-bit output 'out' is equal to the 16-bit input at port 'a', while if 'sel' is 1, then 'out' is equal to 'b'.
	
	
	
	  
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	
	
	
	
				 | 
				
					
	
	 
		Tthank you for explanation
  i solve the problem now i test in hardware simulator
 now i just have to build the chips
  greetings.
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	
	
	
	
				 | 
				
					
	
	 
		hello, i study study, but i need to use to much components(material) not like this one here, he use a little components, can you help me please
	
	
	
	 
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	 Administrator 
	
	
	
				 | 
				
					
	
	
		
michael1978 wrote 
hello, i study study, but i need to use to much components(material) not like this one here, he use a little components, can you help me please
 
 
 
Help you how???
 What you mean by "little components"?
 Without see how you did it, how can we possibly make suggestions to you on how you might have done it better?
	
	
	
	  
				 | 
			 
		 
	 
	
		
		
			
				| 
					
	
	
	
	
				 | 
				
					
	
	 
		i mean, i have to use for ALU a lot of MUX IC components, and he use only 8 MUX IC 74LS157, me i have to use 24 MUX IC 74LS157, i dont know what to do
	
	
	
	 
				 | 
			 
		 
	 
	
		12
	 
	 
                        
                     |