text
stringlengths
59
71.4k
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
#include <bits/stdc++.h> using namespace std; int n, in[200005], a[200005], sta[200005], top, now, root, ans, flag; bool vis[200005], mark[200005]; int read() { int x, f = 1; char ch; while (!(isdigit(ch = getchar()))) ch == - ? f = -1 : f; x = ch - 48; while ((isdigit(ch = getchar()))) x ...
#include <bits/stdc++.h> using namespace std; int64_t max(int32_t a, int64_t b) { return max((int64_t)a, b); } int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); pair<int64_t, int64_t> lc, rc; cin >> rc.second >> rc.first; lc.first = lc.second = 1; int64_t k; c...
#include <bits/stdc++.h> int main() { int a, i, b, k, temp; while (~scanf( %d , &a) && a >= 0) { temp = 0; while (a) { b = a; k = 0; while (b > 0) { if (k < b % 10) k = b % 10; b = b / 10; } a -= k; temp++; } printf( %...
module scheduler1_multi(clk, reset, wen, enablein, datain, dataout, full, empty, enableout); parameter data_width = 32; //parameter data_width1 = 34; parameter data_width1 = 36; parameter address_width = 7; parameter FIFO_depth = 128; parameter number_mapper = 2; input clk,reset,wen,enablein; input [data_width-1:0...
#include <bits/stdc++.h> using namespace std; int a[100000 + 10]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { long long k; cin >> k; for (int i = 1; i <= k; i++) cin >> a[i]; sort(a + 1, a + k + 1); int ans = 1; for (int i = 1; i < k; i++) { ...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
// Copyright (c) 2000-2012 Bluespec, Inc. // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, pub...
//---------------------------------------------------------------------------- // xps_icapi_core.vhd - module //---------------------------------------------------------------------------- `timescale 1 ns / 1 ns module xps_icapi_core #( // -- DO NOT EDIT BELOW THIS LINE ------------------ parameter C_SPLB_NATIVE_D...
//-- ////////////////////////////////////////////////////////////////////////////// //-- /// Copyright (c) 2013, Jahanzeb Ahmad //-- /// All rights reserved. //-- /// //-- /// Redistribution and use in source and binary forms, with or without modification, //-- /// are permitted provided that the following conditions ...
/* Copyright (C) 2014 Adapteva, Inc. Contributed by Fred Huettig <> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later versi...
//***************************************************************************** // (c) Copyright 2008-2010 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using vi = vector<int>; struct ele { int value, jj, index; }; bool ordena(ele a, ele b) { return a.value < b.value; } int main() { ios::sync_with_stdio(false); cin.tie(NULL); int k, n; cin...
#include <bits/stdc++.h> using namespace std; map<string, string> p; int ans = 0; string tmp = abcdef ; void doit(int n, string s) { if (n == 0) { int f = 0; while (true) { if (s.length() == 2) { if (p.find(s) == p.end()) { f = 1; break; } ...
#include <bits/stdc++.h> using namespace std; const int N = 1000000 + 10; int tot; vector<int> primes; int notP[N]; vector<long long> divisors[N]; map<pair<long long, int>, int> dp; int isP(long long x) { for (int i = 0; (long long)primes[i] * primes[i] <= x; ++i) { if (x % primes[i] == 0) ret...
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2014 Francis Bruno, All Rights Reserved // // This program is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by the Free // Software...
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
`timescale 1ns / 1ps //////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 00:11:00 12/11/2012 // Design Name: top // Module Name: E:/Documents/FPGA/SPIloop/tb.v // Project Name: SPIloop // Target Device: // Tool versions: // Descriptio...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 10; vector<int> a[maxn]; string s; int i, ma = -1, ans = 0, f = 1; int main() { cin >> s; for (i = 0; i < s.size(); i++) { if (s[i] == 0 ) a[++ans].push_back(i); else { if (ans == 0) { f = 0; ...
/* * Milkymist VJ SoC * Copyright (C) 2007, 2008, 2009 Sebastien Bourdeauducq * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License. * * This program is distributed ...
// Copyright 2020-2022 F4PGA Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed...
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
`include "../RF/reg_file2.v" module test; reg [4:0] readReg1, readReg2, writeReg; reg [31:0] writeData; reg regWrite, clk; wire [31:0] readData1, readData2; reg_file rf(.readReg1(readReg1), .readReg2(readReg2), .writeReg(writeReg), .writeData(writeData), .regWrite(regWrite), .clk(clk), ...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Dynamic DCM Controller. Derived from sources from TheSeven at: // https://github.com/progranism/Open-Source-FPGA-Bitcoin-Miner // Paul Mumby 2012 ///////////////////////////////////////////////////////////////////...
#include <bits/stdc++.h> int main() { int vis[5] = {0}; int dir[5][5] = {{4, 3, 2}, {1, 4, 3}, {2, 1, 4}, {3, 2, 1}}; int viss[5] = {0}; for (int i = 0; i < 4; i++) { for (int j = 0; j < 3; j++) { int a; scanf( %d , &a); if (a) { viss[dir[i][j]] = 1; v...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int t, n, i, j, k, h = 0; cin >> n; long long int a[n], b[n]; for (i = 0; i < n; ++i) { cin >> a[i] >> b[i]; } if (n == 1) cout << a[0] << endl; if (n > 1) ...
//----------------------------------------------------------------------------- // // (c) Copyright 2008, 2009 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information of Xilinx, Inc. // and is protected under U.S. and international copyright and other // intellectual pr...
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.size(); int pref = 0; int kol = 0; for (int i = 0; i < n; i++) { if (s[i] == # ) kol++; if (s[i] == ( ) pref++; else pref--; if (pref < 0) { cout << -1 ...
#include <bits/stdc++.h> using namespace std; int n, m; long long data[100010], diff[100010], change[100010]; vector<vector<long long> > adj; vector<pair<long long, int> > vp; int main(void) { scanf( %d%d , &n, &m); adj.resize(n + 1, vector<long long>()); for (int i = 0; i < m; i++) scanf( %I64d...
/* lab3_part1.v - A gated D latch * * Copyright (c) 2014, Artem Tovbin <arty99 at gmail dot com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distribut...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
#include <bits/stdc++.h> using namespace std; struct he { int ind; int val; he(int ind_ = 0, int val_ = 0) : ind(ind_), val(val_) {} bool operator<(const he oth) const { return val > oth.val; } }; int n, m, k; vector<int> p[200200], c[200200]; int minv[200200], maxv[200200]; int np[200200]...
`ifndef _REGFILE `define _REGFILE module register_file(clk, out1, out2, readAdd1, readAdd2, write, writeAdd, in, reset); output [15:0] out1, out2; input [15:0] in; input [2:0] readAdd1, readAdd2, writeAdd; input write, clk, reset; wire [15:0] data0, data1, data2, data3, data4, data5, data6, ...
// *************************************************************************** // *************************************************************************** // Copyright 2011(c) Analog Devices, Inc. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // a...
// This is a component of pluto_servo, a PWM servo driver and quadrature // counter for emc2 // Copyright 2006 Jeff Epler <> // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundatio...
#include <bits/stdc++.h> using namespace std; const long long sz = 1e5 + 10; long long ara[sz], n, p; ; bool isValid(long long now) { long long ptr = 1; for (long long i = 1; i <= n; ++i) { while (ptr <= n && ara[ptr] <= now) ptr++; if (ptr - i >= p) return 0; now++; } return...
#include <bits/stdc++.h> using namespace std; const int MOD = (int)1e9 + 7; const int MAXN = (int)3e5 + 3; const int infint = (int)1e9 + 3; const long long inf = (long long)2e18; struct node { int minf, tedf, mimm, tmimm, mipm, tmipm, min, max, lazymax, lazymin; node() { minf = infint, tedf = ...
#include <bits/stdc++.h> using namespace std; vector<vector<int>> graph; vector<int> isBlack; vector<long long> dp[2]; long long previous[2]; void dfs(int curr) { dp[0][curr] = 1 - isBlack[curr]; dp[1][curr] = isBlack[curr]; for (int child : graph[curr]) { dfs(child); previous[0] = d...
(** * Extraction: Extracting ML from Coq *) (* $Date: 2012-05-03 17:52:38 -0400 (Thu, 03 May 2012) $ *) (** * Basic Extraction *) (** In its simplest form, program extraction from Coq is completely straightforward. *) (** First we say what language we want to extract into. Options are OCaml (the most mature),...
#include <bits/stdc++.h> using namespace std; class node { public: int lo, hi, value; node *left, *right; node(const int _lo, const int _hi) { left = right = NULL; lo = _lo, hi = _hi, value = 0; } void build() { if (lo == hi) return; const int mid = (lo + hi) >> 1; ...
module crc #(parameter BITS=8, parameter POLY=7, parameter INIT=0) (input wire i_clk, input wire i_rst, input wire i_stb, input wire i_bit, output wire[BITS-1:0] o_crc); // // Сдвиговый регистр контрольной суммы. reg[BITS-1:0] crcreg; // Провода между регистрами. wire[BITS-1:0] crcwires; // Выходное значение ...
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 500; int a[maxn]; int main(void) { int n, m; cin >> n >> m; int ans = 0; for (int i = 1; i <= m; i++) { int num; scanf( %d , &num); int x, temp; int flag = 0; scanf( %d , &x); temp = x; ...
//`timescale 1ns/1ps module write_to_memory_testbench(); wire [6:0] slave_address; // 7 bit alave address wire [7:0] byte_to_be_writen; // 8 bit value for write wire I2C_mode; // use to select between read and write wire I2C_start; wire I2C_stop; wire I2C_repeat_s...
#include <bits/stdc++.h> using namespace std; namespace zyt { const int N = 1e6 + 10, CH = 20; int f[1 << CH], n; char s[N]; bool check(const int a, const int p) { return a & (1 << p); } int ctoi(const char c) { return c - a ; } void get_max(int &a, const int b) { a = max(a, b); } int work() { sc...
#include <bits/stdc++.h> using namespace std; long long maxi = LLONG_MAX; long long mini = LLONG_MIN; void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL); } long long a[] = {1, 1, 3}; void fn(long long n, long long x) { if (n <= 1) { for (long long i = 0; i < n; i++) { ...
/* Copyright (c) 2016-2018 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
#include <bits/stdc++.h> using namespace std; template <typename T1, typename T2> ostream& operator<<(ostream& os, const pair<T1, T2>& p) { os << ( << p.first << , << p.second << ) ; return os; } template <typename T1, typename T2, typename T3> ostream& operator<<(ostream& os, const tuple<T1, ...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
`timescale 1ns / 1ps //////////////////////////////////////////////////////////////////////////////// // Company: California State University San Bernardino // Engineer: Bogdan Kravtsov // Tyler Clayton // // Create Date: 14:20:00 10/31/2016 // Module Name: MEM_tb // Project Name: MIPS //...
#include <bits/stdc++.h> using namespace std; const double Pi = acos(-1.0); const long long MAXN = 1e6 + 5; long long n, m, t; struct NODE { long long a, b; } v[MAXN]; long long cmp1(NODE a, NODE b) { return a.a < b.a; } long long a[MAXN], b[MAXN]; long long q[MAXN]; int main() { cin >> t; ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int temp[100012], arr[100012], t[100012]; for (int i = 0; i < n; i++) { cin >> arr[i]; t[i] = arr[i]; } sort(t, t + n); int v = 0; for (int i = 0; i < n; i++) { if (t[i] != arr[i]) { ...
#include <bits/stdc++.h> using namespace std; signed main() { long long n, k; cin >> n >> k; vector<long long> a(n); vector<long long> b(n); for (long long i = 0; i < n; i++) { cin >> a[i]; a[i]--; } for (long long i = 0; i < n; i++) { cin >> b[i]; } long long c...
// tb201.v - A WCI::AXI test bench with BFM, DUT, and Monitor/Observer // Copyright (c) 2010 Atomic Rules LLC - ALL RIGHTS RESERVED // // This testbench instances three components, and provides them with a common clock and reset // These three components are connected together with the WCI0_ signal group // 1. A BFM "I...
#include <bits/stdc++.h> using namespace std; const int N = 1 << 18; bool a[N]; vector<int> res; int x, n; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ; cin >> n >> x; res.push_back(0); a[0] = true; for (int i = 1; i <= int((1 << n) - 1); i++) { ...
//name : arbiter //tag : c components //input : input_a:16 //input : input_b:16 //output : output_z:16 //source_file : test.c ///======= /// ///*Created by C2CHIP* // Register Allocation // =================== // Register Name Size // 0 arbiter...
#include <bits/stdc++.h> using namespace std; template <class T> T inline sqr(T x) { return x * x; } template <class T> inline void relaxMin(T &a, T b) { a = min(a, b); } template <class T> inline void relaxMax(T &a, T b) { a = max(a, b); } string str(int i) { char s[100]; spri...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
#include <bits/stdc++.h> char s[1000000]; char ans[1000000]; int main() { int i, len, cnt; char max = 0; while (scanf( %s , s) != EOF) { max = 0; cnt = 1000000 - 1; len = strlen(s); for (i = len - 1; i >= 0; i--) { if (s[i] >= max) { max = s[i]; ans[...
#include <bits/stdc++.h> using namespace std; set<string> st; set<string>::iterator it1; vector<int> dp2(20000, 0), dp3(20000, 0); void solve(string s, int i, string prev) { if (i < 1) return; if (i == 1) { string a = s.substr(i - 1, 2); if (a != prev) st.insert(a); else ...
#include <bits/stdc++.h> using namespace std; const int Nmax = 2005; int n, k; pair<double, double> mij[Nmax * Nmax]; pair<int, int> a[Nmax]; int main() { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i].first >> a[i].second; for (int i = 1; i <= n; i++) for (int j = i + 1; j <= n; j++) ...
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved. // -------------------------------------------------------------------------------- // Tool Version: Vivado v.2016.4 (win64) Build Wed Dec 14 22:35:39 MST 2016 // Date : Sun Jun 04 17:33:00 2017 // Host : GILAMONSTER running 64-bit major release (...
// Copyright (c) 2000 Stephen Williams () // // This source code is free software; you can redistribute it // and/or modify it in source code form under the terms of the GNU // General Public License as published by the Free Software // Foundation; either version 2 of the License, or (at your option) // ...
/* * Copyright (C) 2011 Kiel Friedt * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This p...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
#include <bits/stdc++.h> using namespace std; int n, arr[30010], book[30010]; bool judge() { int ps, gap; int t1 = 1, t2; while (t1 <= n && book[t1]) t1++; t2 = t1 + 1; if (t1 > n) return false; while (t2 <= n && book[t2]) t2++; if (t2 > n) return true; gap = arr[t2] - arr[t1]; ...
/** * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
`timescale 1ns/1ns // SIMULATION - UNUSED // SNK "PCM" chip (in cartridge) module pcm( input CLK_68KCLKB, input nSDROE, SDRMPX, input nSDPOE, SDPMPX, inout [7:0] SDRAD, input [9:8] SDRA_L, input [23:20] SDRA_U, inout [7:0] SDPAD, input [11:8] SDPA, input [7:0] D, output [23:0] A ); reg [...
//---------------------------------------------------------------------------- // Copyright (C) 2009 , Olivier Girard // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must re...
module cia_int ( input clk, // clock input clk7_en, input wr, // write enable input reset, // reset input icrs, // intterupt control register select input ta, // ta (set TA bit in ICR register) input tb, // tb (set TB bit in ICR register) inp...
// $Id: $ ///////////////////////////////////////////////////////////////////// // This file is part of the GOST 28147-89 CryptoCore project // // // // Copyright (c) 2014 Dmitry Murzinov () // //////////////////////////////////////////////////...
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
// Copyright 2020-2022 F4PGA Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed...
#include <bits/stdc++.h> using namespace std; template <typename A> string to_string(A* ptr) { stringstream ss; ss << 0x << std::setw(16) << std::setfill( 0 ) << std::hex << (uint64_t)(uintptr_t)ptr; return ss.str(); } string to_string(char c) { return ((string) + c) + ; } templa...
#include <bits/stdc++.h> const int MAXN = 100100; int st[20][MAXN]; char str[MAXN]; int n; void SparseTable() { for (int i = 0; i < n; i++) st[0][i] = i; for (int j = 1; (1 << j) < n; j++) for (int i = 0; i + (1 << (j - 1)) < n; i++) st[j][i] = (str[st[j - 1][i]] >= str[st[j - 1][i + (1 ...
#include <bits/stdc++.h> using namespace std; const int OO = 0x3f3f3f3f, NegOO = -1 * OO, N = 1e6 + 5, mod = 1e9 + 7; long long gcd(long long x, long long y) { if (y == 0) return x; return gcd(y, x % y); } int main() { int t; cin >> t; while (t--) { int n, x, y, d; cin >> n >> ...
module sm_hex_display ( input [3:0] digit, output reg [6:0] seven_segments ); always @* case (digit) 'h0: seven_segments = 'b0111111; // a b c d e f g 'h1: seven_segments = 'b0000110; // ; 'h2: seven_segments = 'b1011011; // --a-- 'h3: seven_segments = 'b1...
#include <bits/stdc++.h> using namespace std; long long MOD = 1000000007; long long binary_exp(long long a, long long b) { long long ans = 1; while (b > 0) { if (b & 1) { ans = (ans * a); } a = (a * a); b = b >> 1; } return ans; } int fn(int low, vector<int> &a,...
//altpll bandwidth_type="AUTO" CBX_DECLARE_ALL_CONNECTED_PORTS="OFF" clk0_divide_by=1 clk0_duty_cycle=50 clk0_multiply_by=2 clk0_phase_shift="0" compensate_clock="CLK0" device_family="Cyclone IV E" inclk0_input_frequency=20000 intended_device_family="Cyclone IV E" lpm_hint="CBX_MODULE_PREFIX=pll100M" operation_mode="no...
`define SMV `define SUBDIR `ifdef SUBDIR `include "ovl_always_on_edge.v" `else `include "ovl_ported/ovl_always_on_edge.v" `endif `define OVL_INIT_REG /* * File: ovl_always_on_edge_tb.v * Test bench for ovl_alwaysZ_on_edge.v * Includes assertions for verification * Created: 2013-10-10 * * Verified for both vl...
// (c) Copyright 1995-2017 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // laws. // // DISCLAIMER // This disclaimer is not a license and does not grant ...
#include <bits/stdc++.h> std::mt19937 rng( (int)std::chrono::steady_clock::now().time_since_epoch().count()); const int ms = 110000; const int bs = 1000; const int MOD = 998244353; void add(int &a, int b) { a = a + b < MOD ? a + b : a + b - MOD; } int *pivot; bool comp(int x1, int x2) { return pivot...
#include <bits/stdc++.h> using namespace std; const long long MAX = 1e6 + 100; const long long mod = 1e9 + 7; const long long inf = 1e18 + 12; vector<long long> arr(MAX); map<long long, long long> mm; int main() { ios_base::sync_with_stdio(false); cout.tie(NULL); cout.tie(NULL); ; long...
#include <iostream> #include <bits/stdc++.h> using namespace std; int main () { int t; cin >> t; for (int k=0; k<t;k++){ int n; cin >> n; int a[n]; for (int i=0; i<n; i++){ cin >> a[i]; } for (int j=n-1; j>=0; j--){ if(a[j]+j < n){ a[j] = a[j]+a[a[j]+j]; ...
module test (output reg [1:0] foo, input wire [1:0] addr, input wire in0, in1, input wire en0, en1 /* */); localparam foo_default = 2'b00; always @* begin foo = foo_default; case (addr) 0: if (en0) foo[0] = in0; 1: if (en1) foo[1] = in1; 2: foo = {in1, in0}; default: fo...
// This is a component of pluto_servo, a PWM servo driver and quadrature // counter for emc2 // Copyright 2006 Jeff Epler <> // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundatio...
#include <bits/stdc++.h> using namespace std; const long long INF = 1e15; const int MOD = 1e9 + 7; const double EPS = 1e-7; const double PI = acos(-1.0); const int N = 3e5 + 5; long long n, a[N]; int main() { ios::sync_with_stdio(false); cin.tie(NULL), cout.tie(NULL); cin >> n; for (int ...
#include <bits/stdc++.h> using namespace std; template <class T> void rd(T &x) { x = 0; int f = 1; char c; while (!isdigit(c = getchar())) if (c == - ) f = -1; do { x = (x << 1) + (x << 3) + (c ^ 48); } while (isdigit(c = getchar())); x *= f; } const int N = 3e5 + 5; ...
#include <bits/stdc++.h> using namespace std; const int MAX = 200010, INF = 1e9; int cnt[MAX]; int n, c, ans = INF; int mx[MAX], v[MAX]; bool f[MAX]; vector<int> a; bool ok(int x, int y) { if (x == 0) return 1; if (y == 0) return 0; x -= a[y] * min(cnt[a[y]], x / a[y]); if (mx[x] > y - 1...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 17:57:15 07/09/2015 // Design Name: // Module Name: Serializer_10_1 // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies...
module RegisterFile( output reg [15:0] A_Data, B_Data, input [15:0] D_Data, input [2:0] AA, BA, DA, input RW, CLK ); reg [15:0] REGS[7:0]; always@(posedge CLK) if(RW) case(DA) 3'b 000 : REGS[0] = D_Data; 3'b 001 : REGS[1] = D_Data; 3'b 010 : REGS[2] = D_Data; 3'b 011 : REGS[3] = D_Data;...
/* * Copyright 2020 The SkyWater PDK Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
#include <bits/stdc++.h> using namespace std; int sum[1000000 + 5]; int n, k, maxnum, minnum; bool check(int p) { for (int i = 0; i < maxnum; i += p) { int l = i + k; int r = min(maxnum, i + p - 1); if (l < r && sum[r] - sum[l] > 0) return false; } return true; } int main() { ...
#include <bits/stdc++.h> using namespace std; map<int, int> vis; string s[1000009]; int n, m, i; bool dfs(int x, int y) { if (x == n - 1 && y == m - 1) return true; if (x < 0 || y < 0 || x >= n || y >= m || vis[y + x * m] == 1 || s[x][y] == # ) return false; if (x || y) { vis[...
#include <bits/stdc++.h> using namespace std; bool sortbysec(const pair<long long, pair<long long, long long> > &a, const pair<long long, pair<long long, long long> > &b) { return (a.second.first < b.second.first); } bool sortbyth(const pair<long long, pair<long long, long long> > &a, ...
module ctrl (ins, branch, jump, regDst, aluSrc, aluCtr, regWr, memWr, extOp, memtoReg); input [31:0] ins; output reg [3:0] aluCtr; output reg branch; output reg jump; output reg regDst; output reg aluSrc; output reg regWr; output reg memWr; output reg extOp; output reg memtoReg; wire [5...